mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-16 18:30:06 -04:00
feat(highlights): capture wildcard imports as @character.special
This commit is contained in:
parent
c67881c265
commit
d13f0183ba
7 changed files with 32 additions and 6 deletions
|
|
@ -132,11 +132,6 @@
|
||||||
(new_expression
|
(new_expression
|
||||||
constructor: (identifier) @constructor)
|
constructor: (identifier) @constructor)
|
||||||
|
|
||||||
; Variables
|
|
||||||
;----------
|
|
||||||
(namespace_import
|
|
||||||
(identifier) @module)
|
|
||||||
|
|
||||||
; Decorators
|
; Decorators
|
||||||
;----------
|
;----------
|
||||||
(decorator
|
(decorator
|
||||||
|
|
@ -302,6 +297,19 @@
|
||||||
"}"
|
"}"
|
||||||
] @punctuation.special) @none
|
] @punctuation.special) @none
|
||||||
|
|
||||||
|
; Imports
|
||||||
|
;----------
|
||||||
|
(namespace_import
|
||||||
|
"*" @character.special
|
||||||
|
(identifier) @module)
|
||||||
|
|
||||||
|
(namespace_export
|
||||||
|
"*" @character.special
|
||||||
|
(identifier) @module)
|
||||||
|
|
||||||
|
(export_statement
|
||||||
|
"*" @character.special)
|
||||||
|
|
||||||
; Keywords
|
; Keywords
|
||||||
;----------
|
;----------
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -148,6 +148,8 @@
|
||||||
"!"
|
"!"
|
||||||
] @operator
|
] @operator
|
||||||
|
|
||||||
|
(wildcard_import) @character.special
|
||||||
|
|
||||||
(string
|
(string
|
||||||
"/" @string)
|
"/" @string)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -257,6 +257,10 @@
|
||||||
"uses"
|
"uses"
|
||||||
] @keyword.import
|
] @keyword.import
|
||||||
|
|
||||||
|
(import_declaration
|
||||||
|
(asterisk
|
||||||
|
"*" @character.special))
|
||||||
|
|
||||||
; Punctuation
|
; Punctuation
|
||||||
[
|
[
|
||||||
";"
|
";"
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,8 @@
|
||||||
(import_header
|
(import_header
|
||||||
"import" @keyword.import)
|
"import" @keyword.import)
|
||||||
|
|
||||||
|
(wildcard_import) @character.special
|
||||||
|
|
||||||
; The last `simple_identifier` in a `import_header` will always either be a function
|
; The last `simple_identifier` in a `import_header` will always either be a function
|
||||||
; or a type. Classes can appear anywhere in the import path, unlike functions
|
; or a type. Classes can appear anywhere in the import path, unlike functions
|
||||||
(import_header
|
(import_header
|
||||||
|
|
|
||||||
|
|
@ -320,6 +320,9 @@
|
||||||
(aliased_import
|
(aliased_import
|
||||||
"as" @keyword.import)
|
"as" @keyword.import)
|
||||||
|
|
||||||
|
(wildcard_import
|
||||||
|
"*" @character.special)
|
||||||
|
|
||||||
[
|
[
|
||||||
"if"
|
"if"
|
||||||
"elif"
|
"elif"
|
||||||
|
|
|
||||||
|
|
@ -382,6 +382,9 @@
|
||||||
"||"
|
"||"
|
||||||
] @operator
|
] @operator
|
||||||
|
|
||||||
|
(use_wildcard
|
||||||
|
"*" @character.special)
|
||||||
|
|
||||||
; Punctuation
|
; Punctuation
|
||||||
[
|
[
|
||||||
"("
|
"("
|
||||||
|
|
|
||||||
|
|
@ -213,7 +213,11 @@
|
||||||
|
|
||||||
(wildcard) @variable.parameter
|
(wildcard) @variable.parameter
|
||||||
|
|
||||||
(namespace_wildcard) @punctuation.special
|
(namespace_wildcard
|
||||||
|
[
|
||||||
|
"*"
|
||||||
|
"_"
|
||||||
|
] @character.special)
|
||||||
|
|
||||||
(annotation) @attribute
|
(annotation) @attribute
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue