tree-sitter / tree-sitter-ruby

Ruby grammar for tree-sitter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Global variables not highlighted

lmburns opened this issue · comments

I see in your code you have a regex for capturing global variables, but could not find it in the .scm files. I am unsure how to add global variables to them otherwise I would do that and create a pull request.

When using tree-sitter playground in nvim, there is also no capture group name, however when the playground helper is expanded, it does show that it is a global_variable, but doesn't have a name such as rubyTSGlobalVariable.

I have noticed that they do highlight whenever they're involved in string interpolation, but not when they're by themselves. Picture is related:
2022-01-16_20-19

I'll also add that BEGIN or END are not highlighted either

Extra addition:
Would it be possible to separate fully capitalized constants from ordinary types?
Another question would be to separate builtin types from custom types?

I'll try and learn how to do some of this to help contribute.