mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat(highlights)!: @keyword.storage → @keyword.modifier
This commit is contained in:
parent
998b230a77
commit
dccf31f9b1
36 changed files with 43 additions and 44 deletions
|
|
@ -169,7 +169,6 @@ As languages differ quite a lot, here is a set of captures available to you when
|
||||||
@keyword.function ; keywords that define a function (e.g. `func` in Go, `def` in Python)
|
@keyword.function ; keywords that define a function (e.g. `func` in Go, `def` in Python)
|
||||||
@keyword.operator ; operators that are English words (e.g. `and` / `or`)
|
@keyword.operator ; operators that are English words (e.g. `and` / `or`)
|
||||||
@keyword.import ; keywords for including modules (e.g. `import` / `from` in Python)
|
@keyword.import ; keywords for including modules (e.g. `import` / `from` in Python)
|
||||||
@keyword.storage ; modifiers that affect storage in memory or life-time
|
|
||||||
@keyword.type ; keywords describing composite types (e.g. `struct`, `enum`)
|
@keyword.type ; keywords describing composite types (e.g. `struct`, `enum`)
|
||||||
@keyword.modifier ; keywords modifying other constructs (e.g. `const`, `static`, `public`)
|
@keyword.modifier ; keywords modifying other constructs (e.g. `const`, `static`, `public`)
|
||||||
@keyword.repeat ; keywords related to loops (e.g. `for` / `while`)
|
@keyword.repeat ; keywords related to loops (e.g. `for` / `while`)
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
"aliased"
|
"aliased"
|
||||||
"constant"
|
"constant"
|
||||||
"renames"
|
"renames"
|
||||||
] @keyword.storage
|
] @keyword.modifier
|
||||||
|
|
||||||
[
|
[
|
||||||
"with"
|
"with"
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@
|
||||||
[
|
[
|
||||||
"before"
|
"before"
|
||||||
"after"
|
"after"
|
||||||
] @keyword.storage
|
] @keyword.modifier
|
||||||
|
|
||||||
[
|
[
|
||||||
"append"
|
"append"
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@
|
||||||
(type_descriptor)
|
(type_descriptor)
|
||||||
] @type
|
] @type
|
||||||
|
|
||||||
(storage_class_specifier) @keyword.storage
|
(storage_class_specifier) @keyword.modifier
|
||||||
|
|
||||||
[
|
[
|
||||||
(type_qualifier)
|
(type_qualifier)
|
||||||
|
|
@ -178,7 +178,7 @@
|
||||||
] @keyword.modifier
|
] @keyword.modifier
|
||||||
|
|
||||||
(linkage_specification
|
(linkage_specification
|
||||||
"extern" @keyword.storage)
|
"extern" @keyword.modifier)
|
||||||
|
|
||||||
(type_definition
|
(type_definition
|
||||||
declarator: (type_identifier) @type.definition)
|
declarator: (type_identifier) @type.definition)
|
||||||
|
|
|
||||||
|
|
@ -439,7 +439,7 @@
|
||||||
"static"
|
"static"
|
||||||
"volatile"
|
"volatile"
|
||||||
"required"
|
"required"
|
||||||
] @keyword.storage
|
] @keyword.modifier
|
||||||
|
|
||||||
[
|
[
|
||||||
"abstract"
|
"abstract"
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@
|
||||||
[
|
[
|
||||||
"tempvar"
|
"tempvar"
|
||||||
"extern"
|
"extern"
|
||||||
] @keyword.storage
|
] @keyword.modifier
|
||||||
|
|
||||||
[
|
[
|
||||||
"if"
|
"if"
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@
|
||||||
(argument_list
|
(argument_list
|
||||||
.
|
.
|
||||||
(argument)
|
(argument)
|
||||||
((argument) @_cache @keyword.storage
|
((argument) @_cache @keyword.modifier
|
||||||
.
|
.
|
||||||
(argument) @_type @type
|
(argument) @_type @type
|
||||||
(#any-of? @_cache "CACHE")
|
(#any-of? @_cache "CACHE")
|
||||||
|
|
@ -148,8 +148,8 @@
|
||||||
(argument_list
|
(argument_list
|
||||||
.
|
.
|
||||||
(argument)
|
(argument)
|
||||||
(argument) @keyword.storage
|
(argument) @keyword.modifier
|
||||||
(#any-of? @keyword.storage "CACHE" "PARENT_SCOPE")))
|
(#any-of? @keyword.modifier "CACHE" "PARENT_SCOPE")))
|
||||||
|
|
||||||
(normal_command
|
(normal_command
|
||||||
(identifier) @_function
|
(identifier) @_function
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,6 @@
|
||||||
"__global__"
|
"__global__"
|
||||||
"__forceinline__"
|
"__forceinline__"
|
||||||
"__noinline__"
|
"__noinline__"
|
||||||
] @keyword.storage
|
] @keyword.modifier
|
||||||
|
|
||||||
"__launch_bounds__" @keyword.modifier
|
"__launch_bounds__" @keyword.modifier
|
||||||
|
|
|
||||||
|
|
@ -102,16 +102,16 @@
|
||||||
(gshared)
|
(gshared)
|
||||||
(out)
|
(out)
|
||||||
(inout)
|
(inout)
|
||||||
] @keyword.storage
|
] @keyword.modifier
|
||||||
|
|
||||||
(parameter_attribute
|
(parameter_attribute
|
||||||
(return) @keyword.storage)
|
(return) @keyword.modifier)
|
||||||
|
|
||||||
(parameter_attribute
|
(parameter_attribute
|
||||||
(in) @keyword.storage)
|
(in) @keyword.modifier)
|
||||||
|
|
||||||
(parameter_attribute
|
(parameter_attribute
|
||||||
(out) @keyword.storage)
|
(out) @keyword.modifier)
|
||||||
|
|
||||||
(debug) @keyword.debug
|
(debug) @keyword.debug
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
"in"
|
"in"
|
||||||
"out"
|
"out"
|
||||||
"inout"
|
"inout"
|
||||||
] @keyword.storage
|
] @keyword.modifier
|
||||||
|
|
||||||
"~" @operator
|
"~" @operator
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
[
|
[
|
||||||
"input"
|
"input"
|
||||||
"output"
|
"output"
|
||||||
] @keyword.storage
|
] @keyword.modifier
|
||||||
|
|
||||||
; Conditionals
|
; Conditionals
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,7 @@
|
||||||
"in"
|
"in"
|
||||||
"inout"
|
"inout"
|
||||||
"out"
|
"out"
|
||||||
] @keyword.storage
|
] @keyword.modifier
|
||||||
|
|
||||||
; Labels
|
; Labels
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
"in"
|
"in"
|
||||||
"out"
|
"out"
|
||||||
"inout"
|
"inout"
|
||||||
] @keyword.storage
|
] @keyword.modifier
|
||||||
|
|
||||||
[
|
[
|
||||||
"while"
|
"while"
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
"subroutine" @keyword.function
|
"subroutine" @keyword.function
|
||||||
|
|
||||||
(extension_storage_class) @keyword.storage
|
(extension_storage_class) @keyword.modifier
|
||||||
|
|
||||||
((identifier) @variable.builtin
|
((identifier) @variable.builtin
|
||||||
(#lua-match? @variable.builtin "^gl_"))
|
(#lua-match? @variable.builtin "^gl_"))
|
||||||
|
|
|
||||||
|
|
@ -207,7 +207,7 @@
|
||||||
[
|
[
|
||||||
"transient"
|
"transient"
|
||||||
"volatile"
|
"volatile"
|
||||||
] @keyword.storage
|
] @keyword.modifier
|
||||||
|
|
||||||
[
|
[
|
||||||
"return"
|
"return"
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@
|
||||||
] @punctuation.delimiter
|
] @punctuation.delimiter
|
||||||
|
|
||||||
(lifetime
|
(lifetime
|
||||||
(identifier) @keyword.storage)
|
(identifier) @keyword.modifier)
|
||||||
|
|
||||||
(string_literal) @string
|
(string_literal) @string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@
|
||||||
"localexec"
|
"localexec"
|
||||||
(unnamed_addr)
|
(unnamed_addr)
|
||||||
(dll_storage_class)
|
(dll_storage_class)
|
||||||
] @keyword.storage
|
] @keyword.modifier
|
||||||
|
|
||||||
(attribute_name) @attribute
|
(attribute_name) @attribute
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
"@dynamic"
|
"@dynamic"
|
||||||
"volatile"
|
"volatile"
|
||||||
(protocol_qualifier)
|
(protocol_qualifier)
|
||||||
] @keyword.storage
|
] @keyword.modifier
|
||||||
|
|
||||||
; Keywords
|
; Keywords
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
[
|
[
|
||||||
"distinct"
|
"distinct"
|
||||||
"dynamic"
|
"dynamic"
|
||||||
] @keyword.storage
|
] @keyword.modifier
|
||||||
|
|
||||||
; Conditionals
|
; Conditionals
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@
|
||||||
[
|
[
|
||||||
(kPacked)
|
(kPacked)
|
||||||
(kAbsolute)
|
(kAbsolute)
|
||||||
] @keyword.storage
|
] @keyword.modifier
|
||||||
|
|
||||||
(kUses) @keyword.import
|
(kUses) @keyword.import
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@
|
||||||
"ifempty"
|
"ifempty"
|
||||||
] @keyword.conditional
|
] @keyword.conditional
|
||||||
|
|
||||||
"public" @keyword.storage
|
"public" @keyword.modifier
|
||||||
|
|
||||||
(integer) @number
|
(integer) @number
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -282,13 +282,13 @@
|
||||||
"static"
|
"static"
|
||||||
"dyn"
|
"dyn"
|
||||||
"extern"
|
"extern"
|
||||||
] @keyword.storage
|
] @keyword.modifier
|
||||||
|
|
||||||
(lifetime
|
(lifetime
|
||||||
[
|
[
|
||||||
"'"
|
"'"
|
||||||
(identifier)
|
(identifier)
|
||||||
] @keyword.storage)
|
] @keyword.modifier)
|
||||||
|
|
||||||
"fn" @keyword.function
|
"fn" @keyword.function
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -203,7 +203,7 @@
|
||||||
"protected"
|
"protected"
|
||||||
] @keyword.modifier
|
] @keyword.modifier
|
||||||
|
|
||||||
(inline_modifier) @keyword.storage
|
(inline_modifier) @keyword.modifier
|
||||||
|
|
||||||
(null_literal) @constant.builtin
|
(null_literal) @constant.builtin
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -190,7 +190,7 @@
|
||||||
(null) @constant.builtin
|
(null) @constant.builtin
|
||||||
|
|
||||||
; Misc
|
; Misc
|
||||||
(annotation_visibility) @keyword.storage
|
(annotation_visibility) @keyword.modifier
|
||||||
|
|
||||||
(access_modifier) @keyword.modifier
|
(access_modifier) @keyword.modifier
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@
|
||||||
"storage"
|
"storage"
|
||||||
"calldata"
|
"calldata"
|
||||||
"constant"
|
"constant"
|
||||||
] @keyword.storage
|
] @keyword.modifier
|
||||||
|
|
||||||
[
|
[
|
||||||
"for"
|
"for"
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
(alias_expression
|
(alias_expression
|
||||||
(identifier) @label)
|
(identifier) @label)
|
||||||
|
|
||||||
(storage_identifier) @keyword.storage
|
(storage_identifier) @keyword.modifier
|
||||||
|
|
||||||
(_
|
(_
|
||||||
function_name: (identifier) @function)
|
function_name: (identifier) @function)
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@
|
||||||
name: (identifier) @function.method)
|
name: (identifier) @function.method)
|
||||||
|
|
||||||
; Non-type Keywords
|
; Non-type Keywords
|
||||||
(variable_storage_class) @keyword.storage
|
(variable_storage_class) @keyword.modifier
|
||||||
|
|
||||||
(visibility) @keyword.modifier
|
(visibility) @keyword.modifier
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@
|
||||||
(keyword_jsonfile)
|
(keyword_jsonfile)
|
||||||
(keyword_sequencefile)
|
(keyword_sequencefile)
|
||||||
(keyword_volatile)
|
(keyword_volatile)
|
||||||
] @keyword.storage
|
] @keyword.modifier
|
||||||
|
|
||||||
[
|
[
|
||||||
(keyword_case)
|
(keyword_case)
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@
|
||||||
] @keyword.exception
|
] @keyword.exception
|
||||||
|
|
||||||
; Storageclasses
|
; Storageclasses
|
||||||
"local" @keyword.storage
|
"local" @keyword.modifier
|
||||||
|
|
||||||
; Qualifiers
|
; Qualifiers
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -155,4 +155,4 @@
|
||||||
|
|
||||||
"private" @keyword.modifier
|
"private" @keyword.modifier
|
||||||
|
|
||||||
"global" @keyword.storage
|
"global" @keyword.modifier
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
"shared"
|
"shared"
|
||||||
"static"
|
"static"
|
||||||
"const"
|
"const"
|
||||||
] @keyword.storage
|
] @keyword.modifier
|
||||||
|
|
||||||
[
|
[
|
||||||
"pub"
|
"pub"
|
||||||
|
|
|
||||||
|
|
@ -229,7 +229,7 @@
|
||||||
"protected"
|
"protected"
|
||||||
"public"
|
"public"
|
||||||
"static"
|
"static"
|
||||||
] @keyword.storage
|
] @keyword.modifier
|
||||||
|
|
||||||
[
|
[
|
||||||
"and"
|
"and"
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@
|
||||||
|
|
||||||
(edge_identifier) @attribute
|
(edge_identifier) @attribute
|
||||||
|
|
||||||
(port_direction) @keyword.storage
|
(port_direction) @keyword.modifier
|
||||||
|
|
||||||
(port_identifier
|
(port_identifier
|
||||||
(simple_identifier) @variable)
|
(simple_identifier) @variable)
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
"storage"
|
"storage"
|
||||||
"uniform"
|
"uniform"
|
||||||
"workgroup"
|
"workgroup"
|
||||||
] @keyword.storage
|
] @keyword.modifier
|
||||||
|
|
||||||
[
|
[
|
||||||
"read"
|
"read"
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@ field_constant: (IDENTIFIER) @constant
|
||||||
"align"
|
"align"
|
||||||
"callconv"
|
"callconv"
|
||||||
"linksection"
|
"linksection"
|
||||||
] @keyword.storage
|
] @keyword.modifier
|
||||||
|
|
||||||
[
|
[
|
||||||
"comptime"
|
"comptime"
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
|
|
||||||
.annotation build Lsome/annotation;
|
.annotation build Lsome/annotation;
|
||||||
# ^^^^^ @keyword.storage
|
# ^^^^^ @keyword.modifier
|
||||||
# ^^^^ @type
|
# ^^^^ @type
|
||||||
# ^ @punctuation.delimiter
|
# ^ @punctuation.delimiter
|
||||||
value1 = "test"
|
value1 = "test"
|
||||||
|
|
@ -93,7 +93,7 @@
|
||||||
|
|
||||||
.field public static staticFieldWithAnnotation:I
|
.field public static staticFieldWithAnnotation:I
|
||||||
.annotation runtime La/field/annotation;
|
.annotation runtime La/field/annotation;
|
||||||
# ^^^^^^^ @keyword.storage
|
# ^^^^^^^ @keyword.modifier
|
||||||
this = "is"
|
this = "is"
|
||||||
a = "test"
|
a = "test"
|
||||||
.end annotation
|
.end annotation
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue