You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorbet information is largely connected to the actual syntax, and ideally I'd love features like "add/modify/re-order/remove attributes from sorbet sig when changing the method definition."
At a conceptual level, the signatures are part of the ruby structure - but it also isn't officially part of Ruby.
However, I have no idea if that is something that would be in scope for treesitter generally, or the ruby support in particular.
If it wouldn't belong here, where would it? What about ruby 3 RBS files?
The text was updated successfully, but these errors were encountered:
I think you can parse sorbet out of the 'regular' ruby AST easily as a postprocessor. I do not think sorbet should get primary AST nodes, as long they are "regular ruby".
Post processing does conceptually map to the implementation of Sorbet.
I'm pretty new to the concepts of ASTs etc (read: I have no idea what I'm talking about) - does that mean that one could implement a treesitter grammar plugin that depends on the base ruby grammar (this project) and extends it to include connections to sorbet signatures?
does that mean that one could implement a treesitter grammar plugin that depends on the base ruby grammar
This sounds like a good use for tree-sitter's (admittedly poorly documented) "base grammar" feature. You can pass in a base grammar as an additional parameter to the grammar function, which allows you to build on top of an existing grammar. That's what we do for the TypeScript and TSX grammars (tree-sitter/tree-sitter-typescript) to build on the JavaScript grammar (tree-sitter/tree-sitter-javascript).
Sorbet information is largely connected to the actual syntax, and ideally I'd love features like "add/modify/re-order/remove attributes from sorbet
sig
when changing the method definition."At a conceptual level, the signatures are part of the ruby structure - but it also isn't officially part of Ruby.
However, I have no idea if that is something that would be in scope for treesitter generally, or the ruby support in particular.
If it wouldn't belong here, where would it? What about ruby 3 RBS files?
The text was updated successfully, but these errors were encountered: