language-ruby
language-ruby copied to clipboard
Added scopes for many kernel and special methods in tree-sitter parser
Description of the Change
Added scopes for many kernel and special methods in tree-sitter parser. For example:
- visibility methods (
private,protected...) newmethod- Gemfile-specific methods
- lambda notation (
->(a) { }) - attr_accessors
- some predefined constants (
ENV,__FILE__)
Alternate Designs
None.
Benefits
More accurate highlighting.
Possible Drawbacks
None.
Applicable Issues
#252
Disclaimer
- I didn't understand how to "extend" grammars to make Gemfile's grammar separate and just extend ruby grammar with some specials. Is it possible?
- I haven't found any explicit information about available scopes and logic for mapping them to each language-specific situation. So I've done my best effort.
As a heads up, except for the gemfile specific methods, #291 provides scopes for everything in this PR.