Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

Comments and trailing content blocks don't go well together #124

Open
miliog opened this issue Nov 2, 2023 · 1 comment
Open

Comments and trailing content blocks don't go well together #124

miliog opened this issue Nov 2, 2023 · 1 comment

Comments

@miliog
Copy link

miliog commented Nov 2, 2023

[x] I have tested with the master version of typstfmt and not just typst-lsp

When using trailing multi-line content blocks with comments right after the [, the output becomes very confusing and not how I think it should look like.

 #let test(..args) = (
   // do something
 )

 #test(
   a: "test test test test test",
   b: "test test test test test",
 )[ /* test */
   test test test test test test test test test test test test test test test test test test test test test test test test
 ][ /* test */
   test test test test test test test test test test test test test test test test test test test test test test test test
 ][ /* test */
   test test test test test test test test test test test test test test test test test test test test test test test test
 ]

turns into

#test(
  a: "test test test test test",
  b: "test test test test test",
)[ /* test */
  test test test test test test test test test test test test test test test test
  test test test test test test test test ][ /* test */
  test test test test test test test test test test test test test test test test
  test test test test test test test test ][ /* test */
  test test test test test test test test test test test test test test test test
  test test test test test test test test ]

However, I'd like it to look like this:

#test(
  a: "test test test test test",
  b: "test test test test test",
)[ /* test */
  test test test test test test test test test test test test test test test test
  test test test test test test test test
][ /* test */
  test test test test test test test test test test test test test test test test
  test test test test test test test test
][ /* test */
  test test test test test test test test test test test test test test test test
  test test test test test test test test
]

Without the comments or if I place the comments in the next line, it works just fine:

#test(
  a: "test test test test test",
  b: "test test test test test",
)[
  /* test */
  test test test test test test test test test test test test test test test test
  test test test test test test test test
][
  /* test */
  test test test test test test test test test test test test test test test test
  test test test test test test test test
][
  /* test */
  test test test test test test test test test test test test test test test test
  test test test test test test test test
]
@astrale-sharp
Copy link
Owner

Interesting, thanks for the report!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants