elisp-tree-sitter
elisp-tree-sitter copied to clipboard
ruby: identifiers mis-highlighted as "function.method"
The below ruby code:
foo = 123
Gives foo a face of tree-sitter-hl-face:function.method which isn't correct (it should be variable or similar). I poked around a bit and my guess would be the ((identifier) @function.method (#is-not? local)) highlight rule is matching too much suggesting the locals stuff isn't working (?).
I'm guessing it is an issue here vs tree-sitter-ruby, but I'm really not sure.
Yeah, .is-not? predicate is not yet supported by emacs-tree-sitter. The highlighting queries for Ruby need to be rewritten to take that into account.
Currently, they are still just a copy of upstream's. Since I don't use Ruby myself, I would like some Ruby users to own and maintain the queries.
To clarify, is it the lack of support for the .is-not? predicate or the lack of support for local as mentioned in #94?
Also, again to clarify, you are suggesting we could mitigate this lack of support by rewriting the highlighting rules to not rely on .is-not? and local?
To clarify, is it the lack of support for the
.is-not?predicate or the lack of support forlocalas mentioned in #94?
Both: additional predicates in general, and local information to support a particular type of predicate. The former is relatively straightforward. The latter is difficult to make efficient.
Also, again to clarify, you are suggesting we could mitigate this lack of support by rewriting the highlighting rules to not rely on
.is-not?andlocal?
Yeah, until these are implemented.