zig: Fix highlighting of keywords like orelse
, or
, and
(#18323)
This changes the Zig highlights.scm to tag all keywords with `@keyword` and not with `@keyword.<subtype>`, so the highlighting works properly. Closes #9355 Release Notes: - N/A Demo: 
This commit is contained in:
parent
fc9db97ac7
commit
eb71d2f1a8
1 changed files with 25 additions and 55 deletions
|
@ -103,6 +103,7 @@ field_constant: (IDENTIFIER) @constant
|
||||||
(BlockLabel (IDENTIFIER) @tag)
|
(BlockLabel (IDENTIFIER) @tag)
|
||||||
|
|
||||||
[
|
[
|
||||||
|
"fn"
|
||||||
"asm"
|
"asm"
|
||||||
"defer"
|
"defer"
|
||||||
"errdefer"
|
"errdefer"
|
||||||
|
@ -112,74 +113,21 @@ field_constant: (IDENTIFIER) @constant
|
||||||
"enum"
|
"enum"
|
||||||
"opaque"
|
"opaque"
|
||||||
"error"
|
"error"
|
||||||
] @keyword
|
"try"
|
||||||
|
"catch"
|
||||||
[
|
|
||||||
"async"
|
|
||||||
"await"
|
|
||||||
"suspend"
|
|
||||||
"nosuspend"
|
|
||||||
"resume"
|
|
||||||
] @keyword.coroutine
|
|
||||||
|
|
||||||
[
|
|
||||||
"fn"
|
|
||||||
] @keyword
|
|
||||||
|
|
||||||
[
|
|
||||||
"and"
|
|
||||||
"or"
|
|
||||||
"orelse"
|
|
||||||
] @operator
|
|
||||||
|
|
||||||
[
|
|
||||||
"return"
|
|
||||||
] @keyword.return
|
|
||||||
|
|
||||||
[
|
|
||||||
"if"
|
|
||||||
"else"
|
|
||||||
"switch"
|
|
||||||
] @keyword.control
|
|
||||||
|
|
||||||
[
|
|
||||||
"for"
|
"for"
|
||||||
"while"
|
"while"
|
||||||
"break"
|
"break"
|
||||||
"continue"
|
"continue"
|
||||||
] @keyword
|
|
||||||
|
|
||||||
[
|
|
||||||
"usingnamespace"
|
|
||||||
] @constant
|
|
||||||
|
|
||||||
[
|
|
||||||
"try"
|
|
||||||
"catch"
|
|
||||||
] @keyword
|
|
||||||
|
|
||||||
[
|
|
||||||
"anytype"
|
|
||||||
"anyframe"
|
|
||||||
(BuildinTypeExpr)
|
|
||||||
] @type
|
|
||||||
|
|
||||||
[
|
|
||||||
"const"
|
"const"
|
||||||
"var"
|
"var"
|
||||||
"volatile"
|
"volatile"
|
||||||
"allowzero"
|
"allowzero"
|
||||||
"noalias"
|
"noalias"
|
||||||
] @keyword
|
|
||||||
|
|
||||||
[
|
|
||||||
"addrspace"
|
"addrspace"
|
||||||
"align"
|
"align"
|
||||||
"callconv"
|
"callconv"
|
||||||
"linksection"
|
"linksection"
|
||||||
] @keyword.storage
|
|
||||||
|
|
||||||
[
|
|
||||||
"comptime"
|
"comptime"
|
||||||
"export"
|
"export"
|
||||||
"extern"
|
"extern"
|
||||||
|
@ -188,8 +136,30 @@ field_constant: (IDENTIFIER) @constant
|
||||||
"packed"
|
"packed"
|
||||||
"pub"
|
"pub"
|
||||||
"threadlocal"
|
"threadlocal"
|
||||||
|
"async"
|
||||||
|
"await"
|
||||||
|
"suspend"
|
||||||
|
"nosuspend"
|
||||||
|
"resume"
|
||||||
|
"and"
|
||||||
|
"or"
|
||||||
|
"orelse"
|
||||||
|
"return"
|
||||||
|
"if"
|
||||||
|
"else"
|
||||||
|
"switch"
|
||||||
] @keyword
|
] @keyword
|
||||||
|
|
||||||
|
[
|
||||||
|
"usingnamespace"
|
||||||
|
] @constant
|
||||||
|
|
||||||
|
[
|
||||||
|
"anytype"
|
||||||
|
"anyframe"
|
||||||
|
(BuildinTypeExpr)
|
||||||
|
] @type
|
||||||
|
|
||||||
[
|
[
|
||||||
"null"
|
"null"
|
||||||
"unreachable"
|
"unreachable"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue