-
Notifications
You must be signed in to change notification settings - Fork 25
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
Module names aren't highlighting #15
Comments
From what I can tell it looks like these highlights aren't ending up syntax-highlighted to any color: tree-sitter-elixir/queries/highlights.scm Lines 65 to 69 in de3ec57
which is curious because the java queries for example use Maybe it's just a precedence issue? Or maybe github also needs a |
Without The module name gets the |
Ah good find: seems like the problem isn't with the grammar/queries here but something in how GitHub is mapping the tree-sitter scopes to class names. I'm not sure how to get the ball rolling with GitHub support on this. Maybe we can re-use the contact mentioned in #2 (comment) (cc: @josevalim)? |
Yeah, I don’t think |
The tests for Java tree-sitter highlighting are in this file and it confuses me because tokens annotated as Looking at similar tests for JavaScript and Ruby, it looks like modules/classes use the |
@jonatanklosko Correct: I just found out that tree-sitter-java’s highlights aren’t hitting prod traffic, so a better comparison is Python or Ruby in their respective repositories. Apologies for the confusion. |
Is the mapping/theme a part of some open source project or is it something you maintain internally? |
It’s closed-source. I’m dotting my i’s properly and checking to make sure I can give you the whole list without running awry of lawyers. But yes, |
@jonatanklosko Actually, I think I can get that |
Fantastic! |
Okay, the changes required to recognize |
Beautiful, thanks for all the help! I've just merged the change, so we should be good on this side :D |
Some languages have the notion of modules, and to represent those we've started to use a `@module` tag, as discussed in elixir-lang/tree-sitter-elixir#15. Because historically we've used the constructor highlight color for modules in JS/Ruby, it's defined to map to the same color.
Awesome, thanks! The examples linked in the issue description are still the same, is that caching temporary? |
@jonatanklosko Yeah, I think that’s memcached doing its thing. It’ll fall out of cache eventually, heh! |
Perfect :D |
tree-sitter-elixir was pushed live on GitHub today 🎉 , but @the-mikedavis pointed out that module names aren't highlighting
Example: https://github.com/elixir-mint/mint/blob/1ea7731d921840ad75a47fa9415525c3d94b9980/mix.exs#L1-L2
Example 2: https://github.com/elixir-mint/mint/blob/1ea7731d921840ad75a47fa9415525c3d94b9980/lib/mint/http1.ex#L108-L113
CC @patrickt (who asked to be CC'd so he can push an updated grammar on GitHub's end when this is handled.)
The text was updated successfully, but these errors were encountered: