mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-11 12:46:07 +00:00
rust: Fix doc comment highlighting (#17976)
This PR fixes an issue where `/` and `!` in Rust doc comments were being incorrectly highlighted as operators after #17734. We solve this by removing them from the operators list and using more scoped queries to highlight them. Release Notes: - N/A --------- Co-authored-by: Max <max@zed.dev>
This commit is contained in:
parent
e7912370e6
commit
db18f7a2b0
1 changed files with 4 additions and 2 deletions
|
@ -139,7 +139,6 @@
|
||||||
] @comment.doc
|
] @comment.doc
|
||||||
|
|
||||||
[
|
[
|
||||||
"!"
|
|
||||||
"!="
|
"!="
|
||||||
"%"
|
"%"
|
||||||
"%="
|
"%="
|
||||||
|
@ -159,7 +158,6 @@
|
||||||
".."
|
".."
|
||||||
"..="
|
"..="
|
||||||
"..."
|
"..."
|
||||||
"/"
|
|
||||||
"/="
|
"/="
|
||||||
":"
|
":"
|
||||||
";"
|
";"
|
||||||
|
@ -183,6 +181,10 @@
|
||||||
"?"
|
"?"
|
||||||
] @operator
|
] @operator
|
||||||
|
|
||||||
|
; Avoid highlighting these as operators when used in doc comments.
|
||||||
|
(unary_expression "!" @operator)
|
||||||
|
operator: "/" @operator
|
||||||
|
|
||||||
(lifetime) @lifetime
|
(lifetime) @lifetime
|
||||||
|
|
||||||
(parameter (identifier) @variable.parameter)
|
(parameter (identifier) @variable.parameter)
|
||||||
|
|
Loading…
Reference in a new issue