feat(highlights): capture wildcard imports as @character.special

This commit is contained in:
Omar Valdez 2024-08-01 01:24:40 -07:00 committed by GitHub
parent c67881c265
commit d13f0183ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 32 additions and 6 deletions

View file

@ -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
;----------
[

View file

@ -148,6 +148,8 @@
"!"
] @operator
(wildcard_import) @character.special
(string
"/" @string)

View file

@ -257,6 +257,10 @@
"uses"
] @keyword.import
(import_declaration
(asterisk
"*" @character.special))
; Punctuation
[
";"

View file

@ -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

View file

@ -320,6 +320,9 @@
(aliased_import
"as" @keyword.import)
(wildcard_import
"*" @character.special)
[
"if"
"elif"

View file

@ -382,6 +382,9 @@
"||"
] @operator
(use_wildcard
"*" @character.special)
; Punctuation
[
"("

View file

@ -213,7 +213,11 @@
(wildcard) @variable.parameter
(namespace_wildcard) @punctuation.special
(namespace_wildcard
[
"*"
"_"
] @character.special)
(annotation) @attribute