Closed workingjubilee closed 2 years ago
The use of treesitter grammars is independent of Linguist and would need a change in the syntax highlighting engine. We can however switch to one of the other TextMate compatible grammars in the mean time.
Of the two, https://github.com/dustypomerleau/rust-syntax looks to have been the most recently updated so we can start there.
🤔 Where and when did you see the syntax highlighting in your screenshot?
I ask as it doesn't look like that right now:
Box<dyn std::error::Error>,
> #user_code
})
.wrap_err("Parsing generated user trigger")?;
Maybe we won't need to change the grammar right now after all.
Nothing to do here now as the upstream highlighting engine now implements the treesitter Rust grammar. Closing.
Describe the bug
Hello!
This screenshot features a string being highlighted using the same color as for function highlighting. These are normally highlighted very differently. I believe I understand the cause, however.
The Atom project is being sunsetted, and the associated Atom-derived syntax highlighting for Rust has had the repo archived and no longer maintained for some 3 years now, at least. Since it was last in regular maintenance, some subtle changes to Rust syntax have emerged in Edition 2021, and some interesting cases that it was not prepared for, like this macro syntactic embedding, have emerged in the language.
Expected behaviour
I expected this string to be highlighted like a string, not like a function.
Additional notes
There is a tree-sitter grammar for Rust, and I see tree-sitter is used elsewhere in this repo, so perhaps that can be used here? I am not aware of how annoying that would be. The rust-analyzer extension is generally the most up to date and can provide quite a lot of syntactic and semantic analysis power for Rust, but it is meant to be used as a full-blown language server. Seems slightly overkill.