mirror of
https://github.com/nvim-treesitter/nvim-treesitter
synced 2024-09-16 14:34:05 +02:00
feat: standardize and document export keywords
Many export keywords are captured as `@keyword.import`. This commit makes it so they are all captured like that, and mentions it in the documentation.
This commit is contained in:
parent
0d2c80b4d0
commit
d5a1c2b0c8
11 changed files with 22 additions and 29 deletions
|
@ -167,7 +167,7 @@ As languages differ quite a lot, here is a set of captures available to you when
|
||||||
@keyword.coroutine ; keywords related to coroutines (e.g. `go` in Go, `async/await` in Python)
|
@keyword.coroutine ; keywords related to coroutines (e.g. `go` in Go, `async/await` in Python)
|
||||||
@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 or exporting modules (e.g. `import` / `from` in Python)
|
||||||
@keyword.type ; keywords describing namespaces and composite types (e.g. `struct`, `enum`)
|
@keyword.type ; keywords describing namespaces and 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`)
|
||||||
|
|
|
@ -93,13 +93,14 @@
|
||||||
[
|
[
|
||||||
"declare"
|
"declare"
|
||||||
"typeset"
|
"typeset"
|
||||||
"export"
|
|
||||||
"readonly"
|
"readonly"
|
||||||
"local"
|
"local"
|
||||||
"unset"
|
"unset"
|
||||||
"unsetenv"
|
"unsetenv"
|
||||||
] @keyword
|
] @keyword
|
||||||
|
|
||||||
|
"export" @keyword.import
|
||||||
|
|
||||||
"function" @keyword.function
|
"function" @keyword.function
|
||||||
|
|
||||||
(special_variable_name) @constant
|
(special_variable_name) @constant
|
||||||
|
|
|
@ -314,20 +314,10 @@
|
||||||
[
|
[
|
||||||
"import"
|
"import"
|
||||||
"from"
|
"from"
|
||||||
|
"as"
|
||||||
|
"export"
|
||||||
] @keyword.import
|
] @keyword.import
|
||||||
|
|
||||||
(export_specifier
|
|
||||||
"as" @keyword.import)
|
|
||||||
|
|
||||||
(import_specifier
|
|
||||||
"as" @keyword.import)
|
|
||||||
|
|
||||||
(namespace_export
|
|
||||||
"as" @keyword.import)
|
|
||||||
|
|
||||||
(namespace_import
|
|
||||||
"as" @keyword.import)
|
|
||||||
|
|
||||||
[
|
[
|
||||||
"for"
|
"for"
|
||||||
"of"
|
"of"
|
||||||
|
@ -340,7 +330,6 @@
|
||||||
"break"
|
"break"
|
||||||
"const"
|
"const"
|
||||||
"debugger"
|
"debugger"
|
||||||
"export"
|
|
||||||
"extends"
|
"extends"
|
||||||
"get"
|
"get"
|
||||||
"let"
|
"let"
|
||||||
|
|
|
@ -215,7 +215,6 @@
|
||||||
"signal"
|
"signal"
|
||||||
"var"
|
"var"
|
||||||
"onready"
|
"onready"
|
||||||
"export"
|
|
||||||
"setget"
|
"setget"
|
||||||
"remote"
|
"remote"
|
||||||
"master"
|
"master"
|
||||||
|
@ -225,6 +224,8 @@
|
||||||
"puppetsync"
|
"puppetsync"
|
||||||
] @keyword
|
] @keyword
|
||||||
|
|
||||||
|
"export" @keyword.import
|
||||||
|
|
||||||
[
|
[
|
||||||
"enum"
|
"enum"
|
||||||
"class"
|
"class"
|
||||||
|
|
|
@ -20,7 +20,10 @@
|
||||||
(#lua-match? @constant "^[A-Z_]+$"))
|
(#lua-match? @constant "^[A-Z_]+$"))
|
||||||
|
|
||||||
; Includes
|
; Includes
|
||||||
"use" @keyword.import
|
[
|
||||||
|
"use"
|
||||||
|
"export"
|
||||||
|
] @keyword.import
|
||||||
|
|
||||||
(use_statement
|
(use_statement
|
||||||
(scoped_type_identifier
|
(scoped_type_identifier
|
||||||
|
@ -41,7 +44,6 @@
|
||||||
; Keywords
|
; Keywords
|
||||||
[
|
[
|
||||||
"def"
|
"def"
|
||||||
"export"
|
|
||||||
"let"
|
"let"
|
||||||
] @keyword
|
] @keyword
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,10 @@
|
||||||
[
|
[
|
||||||
"local"
|
"local"
|
||||||
"type"
|
"type"
|
||||||
"export"
|
|
||||||
] @keyword
|
] @keyword
|
||||||
|
|
||||||
|
"export" @keyword.import
|
||||||
|
|
||||||
(do_statement
|
(do_statement
|
||||||
[
|
[
|
||||||
"do"
|
"do"
|
||||||
|
|
|
@ -37,8 +37,10 @@
|
||||||
"|"
|
"|"
|
||||||
] @operator)
|
] @operator)
|
||||||
|
|
||||||
(export_directive
|
[
|
||||||
"export" @keyword)
|
"export"
|
||||||
|
"unexport"
|
||||||
|
] @keyword.import
|
||||||
|
|
||||||
(override_directive
|
(override_directive
|
||||||
"override" @keyword)
|
"override" @keyword)
|
||||||
|
|
|
@ -102,7 +102,6 @@
|
||||||
"property"
|
"property"
|
||||||
"signal"
|
"signal"
|
||||||
"declare"
|
"declare"
|
||||||
"export"
|
|
||||||
"implements"
|
"implements"
|
||||||
"override"
|
"override"
|
||||||
] @keyword
|
] @keyword
|
||||||
|
|
|
@ -184,7 +184,7 @@
|
||||||
; Keywords:
|
; Keywords:
|
||||||
(animate_option_identifier) @keyword
|
(animate_option_identifier) @keyword
|
||||||
|
|
||||||
(export) @keyword
|
(export) @keyword.import
|
||||||
|
|
||||||
(if_statement
|
(if_statement
|
||||||
"if" @keyword.conditional)
|
"if" @keyword.conditional)
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
[
|
[
|
||||||
"declare"
|
"declare"
|
||||||
"export"
|
|
||||||
"implements"
|
"implements"
|
||||||
"type"
|
"type"
|
||||||
"override"
|
"override"
|
||||||
|
@ -32,9 +31,6 @@
|
||||||
(as_expression
|
(as_expression
|
||||||
"as" @keyword.operator)
|
"as" @keyword.operator)
|
||||||
|
|
||||||
(export_statement
|
|
||||||
"as" @keyword.operator)
|
|
||||||
|
|
||||||
(mapped_type_clause
|
(mapped_type_clause
|
||||||
"as" @keyword.operator)
|
"as" @keyword.operator)
|
||||||
|
|
||||||
|
|
|
@ -139,7 +139,10 @@ field_constant: (IDENTIFIER) @constant
|
||||||
"continue"
|
"continue"
|
||||||
] @keyword.repeat
|
] @keyword.repeat
|
||||||
|
|
||||||
"usingnamespace" @keyword.import
|
[
|
||||||
|
"usingnamespace"
|
||||||
|
"export"
|
||||||
|
] @keyword.import
|
||||||
|
|
||||||
[
|
[
|
||||||
"try"
|
"try"
|
||||||
|
@ -168,7 +171,6 @@ field_constant: (IDENTIFIER) @constant
|
||||||
|
|
||||||
[
|
[
|
||||||
"comptime"
|
"comptime"
|
||||||
"export"
|
|
||||||
"extern"
|
"extern"
|
||||||
"inline"
|
"inline"
|
||||||
"noinline"
|
"noinline"
|
||||||
|
|
Loading…
Reference in a new issue