mirror of
https://github.com/nvim-treesitter/nvim-treesitter
synced 2024-09-16 14:34:05 +02: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
|
||||
constructor: (identifier) @constructor)
|
||||
|
||||
; Variables
|
||||
;----------
|
||||
(namespace_import
|
||||
(identifier) @module)
|
||||
|
||||
; Decorators
|
||||
;----------
|
||||
(decorator
|
||||
|
@ -302,6 +297,19 @@
|
|||
"}"
|
||||
] @punctuation.special) @none
|
||||
|
||||
; Imports
|
||||
;----------
|
||||
(namespace_import
|
||||
"*" @character.special
|
||||
(identifier) @module)
|
||||
|
||||
(namespace_export
|
||||
"*" @character.special
|
||||
(identifier) @module)
|
||||
|
||||
(export_statement
|
||||
"*" @character.special)
|
||||
|
||||
; Keywords
|
||||
;----------
|
||||
[
|
||||
|
|
|
@ -148,6 +148,8 @@
|
|||
"!"
|
||||
] @operator
|
||||
|
||||
(wildcard_import) @character.special
|
||||
|
||||
(string
|
||||
"/" @string)
|
||||
|
||||
|
|
|
@ -257,6 +257,10 @@
|
|||
"uses"
|
||||
] @keyword.import
|
||||
|
||||
(import_declaration
|
||||
(asterisk
|
||||
"*" @character.special))
|
||||
|
||||
; Punctuation
|
||||
[
|
||||
";"
|
||||
|
|
|
@ -73,6 +73,8 @@
|
|||
(import_header
|
||||
"import" @keyword.import)
|
||||
|
||||
(wildcard_import) @character.special
|
||||
|
||||
; 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
|
||||
(import_header
|
||||
|
|
|
@ -320,6 +320,9 @@
|
|||
(aliased_import
|
||||
"as" @keyword.import)
|
||||
|
||||
(wildcard_import
|
||||
"*" @character.special)
|
||||
|
||||
[
|
||||
"if"
|
||||
"elif"
|
||||
|
|
|
@ -382,6 +382,9 @@
|
|||
"||"
|
||||
] @operator
|
||||
|
||||
(use_wildcard
|
||||
"*" @character.special)
|
||||
|
||||
; Punctuation
|
||||
[
|
||||
"("
|
||||
|
|
|
@ -213,7 +213,11 @@
|
|||
|
||||
(wildcard) @variable.parameter
|
||||
|
||||
(namespace_wildcard) @punctuation.special
|
||||
(namespace_wildcard
|
||||
[
|
||||
"*"
|
||||
"_"
|
||||
] @character.special)
|
||||
|
||||
(annotation) @attribute
|
||||
|
||||
|
|
Loading…
Reference in a new issue