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

Highlighting does not work for deeply nested brackets inside string templates #451

Open
ZiyaoWei opened this issue May 28, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@ZiyaoWei
Copy link

image

Not sure if this is a flix issue or a VSCode extension issue.

If it is worth it I'd love to look into it, would appreciate some pointers :-)

@mlutze
Copy link
Member

mlutze commented May 30, 2023

There are actually two sources of highlighting: syntactic and semantic. The extension provides the syntactic highlighting here: https://github.com/flix/vscode-flix/blob/master/syntaxes/flix.tmLanguage.json
And the semantic highlighting is provided by the compiler.

I suspect there is an issue with the syntactic highlighting rules. You can read about VSCode's API for that here: https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide

@ZiyaoWei
Copy link
Author

ZiyaoWei commented Jun 1, 2023

I actually think this is more of a brackets matching issue:

image

Note the horizontal bracket guides are apparently only considering ()s and not {}s, which should probably be fixed - will see if that fixes the issue.

EDIT: It seems that the issue is the template aren't being parsed correctly with the regexes, will look into it.

@ZiyaoWei
Copy link
Author

ZiyaoWei commented Jun 1, 2023

It seems the real issue here is that the punctuation.definition.template-expression.begin.flix is not being matched with the right punctuation.definition.template-expression.end.flix, which confused the built in brackets matching algorithm. Will dig a bit more but probably not enough of a regex wizard to fix this bug.

@magnus-madsen magnus-madsen added the bug Something isn't working label Jun 5, 2023
@JonathanStarup JonathanStarup transferred this issue from flix/flix Sep 23, 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

No branches or pull requests

3 participants