-
Notifications
You must be signed in to change notification settings - Fork 34
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 keyword matching #289
Comments
Thanks for asking, seems fine to me! |
Ok, so I actually got started working on this, and ended up having a pretty difficult time. It turns out that the highlights.scm on main doesn't compile. At issue is the following line:
I tried tracking down what was up, but I don't fully understand what's going on in the grammar with it. I know nearly zero about grammars, but what is going on here?
|
So that alias exists because without it, I have highlight tests running on CI so some environment does exist where those queries compile. What version of treesitter are you using? |
And I finally have circled back to this. Sorry for dropping the ball. I've just updated to tree-sitter 0.20.9. This line in the highlights continues to fail to compile with a Commenting out that one statement allows the query to be parsed. |
I noticed a highlighting issue with Swift sources, and have tracked it down to how the
highlighting.scm
file is set up. At issue is how some keywords are matched. As an example, consider the code snippet:The visibility modifiers are only matched with the
visibility_modifier
node, so in this casepublic
will not be highlighted. But, the grammar totally can recognizepublic
at this point, despite the incomplete code.I'd like to propose matching all keywords with their plain tokens. I believe this will both improve quality and performance of highlighting. However, this isn't a 100% trivial change to the scm file, so I wanted to check in first before opening up a PR.
The text was updated successfully, but these errors were encountered: