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

Left parenthesis character literal messes up following syntax highlighting #1195

Open
Anders-E opened this issue Jun 4, 2021 · 2 comments
Open
Labels
bug Something isn't working highlight Syntax highlighting, rainbow parens, such things

Comments

@Anders-E
Copy link

Anders-E commented Jun 4, 2021

Might be a bit hard to see but notice how the nil after \( has a different color than the nil after \).
Using Calva 2.0.199.

( nil ) nil

@PEZ PEZ added highlight Syntax highlighting, rainbow parens, such things bug Something isn't working labels Jun 5, 2021
@PEZ
Copy link
Collaborator

PEZ commented Jun 5, 2021

Thanks. I tested this in Atom where it behaves the same, so that means the error lives in the tmLanguage grammar. Probably here:

'match': '(?<=\\()([^"]+?)(?=\\s|\\))'

Not completely sure but it looks like it treats the opening paren as the start of a list and then nil is in function position and it gets tokenized as being a function call. I think I've seen similar idiosyncrasies with what we treat as being a function call.

If you want to help fix it, please see https://github.com/BetterThanTomorrow/calva/wiki/How-to-Hack-on-Calva#updating-the-tmlanguge-grammar

It is pretty well covered with tests so once the tests for this fix runs and the other tests run it is very likely fixed properly. 😄

@Anders-E
Copy link
Author

Anders-E commented Jun 5, 2021

Thank you for the quick and detailed reply! I'll see if I can spare some time to have a look at it this weekend.

Thank you for the pointers and for making Calva, I really enjoy using it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working highlight Syntax highlighting, rainbow parens, such things
Projects
None yet
Development

No branches or pull requests

2 participants