mirror of
https://github.com/nvim-treesitter/nvim-treesitter
synced 2024-09-08 02:35:43 +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.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.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.modifier ; keywords modifying other constructs (e.g. `const`, `static`, `public`)
|
||||
@keyword.repeat ; keywords related to loops (e.g. `for` / `while`)
|
||||
|
|
|
@ -93,13 +93,14 @@
|
|||
[
|
||||
"declare"
|
||||
"typeset"
|
||||
"export"
|
||||
"readonly"
|
||||
"local"
|
||||
"unset"
|
||||
"unsetenv"
|
||||
] @keyword
|
||||
|
||||
"export" @keyword.import
|
||||
|
||||
"function" @keyword.function
|
||||
|
||||
(special_variable_name) @constant
|
||||
|
|
|
@ -314,20 +314,10 @@
|
|||
[
|
||||
"import"
|
||||
"from"
|
||||
"as"
|
||||
"export"
|
||||
] @keyword.import
|
||||
|
||||
(export_specifier
|
||||
"as" @keyword.import)
|
||||
|
||||
(import_specifier
|
||||
"as" @keyword.import)
|
||||
|
||||
(namespace_export
|
||||
"as" @keyword.import)
|
||||
|
||||
(namespace_import
|
||||
"as" @keyword.import)
|
||||
|
||||
[
|
||||
"for"
|
||||
"of"
|
||||
|
@ -340,7 +330,6 @@
|
|||
"break"
|
||||
"const"
|
||||
"debugger"
|
||||
"export"
|
||||
"extends"
|
||||
"get"
|
||||
"let"
|
||||
|
|
|
@ -215,7 +215,6 @@
|
|||
"signal"
|
||||
"var"
|
||||
"onready"
|
||||
"export"
|
||||
"setget"
|
||||
"remote"
|
||||
"master"
|
||||
|
@ -225,6 +224,8 @@
|
|||
"puppetsync"
|
||||
] @keyword
|
||||
|
||||
"export" @keyword.import
|
||||
|
||||
[
|
||||
"enum"
|
||||
"class"
|
||||
|
|
|
@ -20,7 +20,10 @@
|
|||
(#lua-match? @constant "^[A-Z_]+$"))
|
||||
|
||||
; Includes
|
||||
"use" @keyword.import
|
||||
[
|
||||
"use"
|
||||
"export"
|
||||
] @keyword.import
|
||||
|
||||
(use_statement
|
||||
(scoped_type_identifier
|
||||
|
@ -41,7 +44,6 @@
|
|||
; Keywords
|
||||
[
|
||||
"def"
|
||||
"export"
|
||||
"let"
|
||||
] @keyword
|
||||
|
||||
|
|
|
@ -7,9 +7,10 @@
|
|||
[
|
||||
"local"
|
||||
"type"
|
||||
"export"
|
||||
] @keyword
|
||||
|
||||
"export" @keyword.import
|
||||
|
||||
(do_statement
|
||||
[
|
||||
"do"
|
||||
|
|
|
@ -37,8 +37,10 @@
|
|||
"|"
|
||||
] @operator)
|
||||
|
||||
(export_directive
|
||||
"export" @keyword)
|
||||
[
|
||||
"export"
|
||||
"unexport"
|
||||
] @keyword.import
|
||||
|
||||
(override_directive
|
||||
"override" @keyword)
|
||||
|
|
|
@ -102,7 +102,6 @@
|
|||
"property"
|
||||
"signal"
|
||||
"declare"
|
||||
"export"
|
||||
"implements"
|
||||
"override"
|
||||
] @keyword
|
||||
|
|
|
@ -184,7 +184,7 @@
|
|||
; Keywords:
|
||||
(animate_option_identifier) @keyword
|
||||
|
||||
(export) @keyword
|
||||
(export) @keyword.import
|
||||
|
||||
(if_statement
|
||||
"if" @keyword.conditional)
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
[
|
||||
"declare"
|
||||
"export"
|
||||
"implements"
|
||||
"type"
|
||||
"override"
|
||||
|
@ -32,9 +31,6 @@
|
|||
(as_expression
|
||||
"as" @keyword.operator)
|
||||
|
||||
(export_statement
|
||||
"as" @keyword.operator)
|
||||
|
||||
(mapped_type_clause
|
||||
"as" @keyword.operator)
|
||||
|
||||
|
|
|
@ -139,7 +139,10 @@ field_constant: (IDENTIFIER) @constant
|
|||
"continue"
|
||||
] @keyword.repeat
|
||||
|
||||
"usingnamespace" @keyword.import
|
||||
[
|
||||
"usingnamespace"
|
||||
"export"
|
||||
] @keyword.import
|
||||
|
||||
[
|
||||
"try"
|
||||
|
@ -168,7 +171,6 @@ field_constant: (IDENTIFIER) @constant
|
|||
|
||||
[
|
||||
"comptime"
|
||||
"export"
|
||||
"extern"
|
||||
"inline"
|
||||
"noinline"
|
||||
|
|
Loading…
Reference in a new issue