Improve Python syntax highlighting (#25331)
Release Notes: - Improved Python syntax highlighting. | Zed 0.174.6 | With this PR | | --- | --- | |  |  | - `identifier`: `variable` - `.`, `,`, `:`: `punctuation.delimiter` - `@`: `operator`, for matrix multiplication ```python class Mat(list): def __matmul__(self, b): ... a, b = Mat(), Mat() identifier = a @ b IDENTIFIER = True ``` --------- Co-authored-by: Marshall Bowers <git@maxdeviant.com>
This commit is contained in:
parent
10a6cd00e7
commit
59a153b2e1
1 changed files with 8 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
|||
((identifier) @constant
|
||||
(#match? @constant "^_*[A-Z][A-Z0-9_]*$"))
|
||||
|
||||
(identifier) @variable
|
||||
(attribute attribute: (identifier) @property)
|
||||
(type (identifier) @type)
|
||||
(generic_type (identifier) @type)
|
||||
|
@ -117,6 +118,12 @@
|
|||
(#match? @variable.special "^self|cls$")
|
||||
]
|
||||
|
||||
[
|
||||
"."
|
||||
","
|
||||
":"
|
||||
] @punctuation.delimiter
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
|
@ -190,6 +197,7 @@
|
|||
"&"
|
||||
"%"
|
||||
"%="
|
||||
"@"
|
||||
"^"
|
||||
"+"
|
||||
"->"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue