rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
14.31k stars 1.62k forks source link

The > in the fat arrow => is categorized semantically as an angle bracket in macros. #18505

Open Quelfth opened 1 week ago

Quelfth commented 1 week ago

rust-analyzer version: 0.3.2180-standalone (30e71b609 2024-11-10)

rustc version: 1.81.0 (eeb90cda1 2024-09-04)

editor or extension: VS Code + rust-analyzer v0.3.2180

code snippet to reproduce:

macro_rules! a_macro {
    () => {}
}

Image

In my color scheme, fat arrows are supposed to be green, and the textmate tokens correctly categorize => as fat arrow here. However, the > part of the arrow token has the semantic token type "angle", even though as far as I'm aware, a > which is part of a => token can never function as an angle bracket, and it certainly does not have this function in this case. As far as I'm aware, this happens for any => which is part of the syntax for a macro invocation or definition.