Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax Highlighting gets confused by the REF element supplement parameter #853

Closed
BlackspireAudio opened this issue Nov 19, 2024 · 2 comments · Fixed by #856
Closed

Syntax Highlighting gets confused by the REF element supplement parameter #853

BlackspireAudio opened this issue Nov 19, 2024 · 2 comments · Fixed by #856
Labels
bug Something isn't working

Comments

@BlackspireAudio
Copy link

Describe the bug
According to https://typst.app/docs/reference/model/ref/ it is possible to specify a supplement to @[supplement] references in typst.
I use the supplement parameter select between the section or section name reference templates in my custom REF override.
As you can see in the attached screenshot, the syntax highlighting interprets the closing bracket of the REF supplement as the closing bracket of the block. Eventually, the closing bracket of the block is colored as an error.
image

This is not a significant issue, as the code compiles just fine.

Package/Software version:

tinymist extension version: v0.12.2.
vscode version: v1.95.2
os version: linux 6.11.6-arch1-1

@Myriad-Dreamin
Copy link
Owner

It is hard to do syntax highlighting on typst's brackets ('[', ']'), as typst permits unbalanced brackets in top-level markup but it introduces bad bracket colorization. I'll considering whether we should render all brackets, which is bad in the above mentioned case but works well in more common cases.

@Myriad-Dreamin Myriad-Dreamin linked a pull request Nov 19, 2024 that will close this issue
@Myriad-Dreamin
Copy link
Owner

I came up with some tricks when I wrote the reply. Now it should render all brackets correctly:

ae8c093f597af99405943397d1a4fdb3

@Myriad-Dreamin Myriad-Dreamin added the bug Something isn't working label Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants