tree-sitter / tree-sitter-rust

Rust grammar for tree-sitter
MIT License
353 stars 100 forks source link

Operators are not being highlighted #87

Closed Avi-D-coder closed 1 year ago

Avi-D-coder commented 4 years ago

Other tree-sitter grammars parse ->, &&, +=, etc. as an operator. This grammar should be consistent with the standard convention.

GrayJack commented 3 years ago

Pretty sure && and += are in the operator logic, they all show up in the operator field in the s-expr tree.

Now, -> is not a operator by the official Rust syntax, and in this grammar it is not in a field, but I think it's possible to match a string in the queries. So, maybe is the highlight query that needs a update? I'm not sure because I just started to learn about the queries and how they work

resolritter commented 3 years ago

Maybe it's what's being reported in https://github.com/tree-sitter/tree-sitter-rust/issues/98?