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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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