This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit d121307
committed
Auto merge of rust-lang#12220 - arzg:fix-character-semantic-token, r=arzg
Fix `character` semantic token type definition
The semantic token type for character literals is called `character`:
https://github.com/rust-lang/rust-analyzer/blob/94fa8a6534cf93276ad7e205026402f24d41a0b2/crates/rust-analyzer/src/semantic_tokens.rs#L51
and yet the definition in `package.json` uses `char`. In practice this means trying to highlight `char` doesn’t have any effect, while `character` doesn’t have any hover documentation and doesn’t appear in autocomplete. The definition also defines the fallback semantic token type as `type`; luckily since it currently references the non-existent `char` this doesn’t have any effect, since it doesn’t really make sense to highlight character literals as types.
This PR fixes the definition in `package.json` to correctly reference `character`, and also defines the fallback type as `number`. I’d say character literals are closer to a shorthand for writing a number than a string, though this is debatable and I’d be happy to change it to `string`, or anything else.1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1216 | 1216 | | |
1217 | 1217 | | |
1218 | 1218 | | |
1219 | | - | |
| 1219 | + | |
1220 | 1220 | | |
1221 | | - | |
| 1221 | + | |
1222 | 1222 | | |
1223 | 1223 | | |
1224 | 1224 | | |
| |||
0 commit comments