mirror of
https://github.com/zed-industries/zed.git
synced 2024-09-19 02:17:35 +03:00
Improve Python syntax highlighting (#12868)
Release Notes: - Improve syntax highlighting in Python #12578 Before: <img width="1181" alt="Screenshot 2024-06-08 at 01 44 54" src="https://github.com/zed-industries/zed/assets/87859239/0b8ab26b-149b-477e-af08-8cd9f2b1c117"> After: <img width="1184" alt="Screenshot 2024-06-10 at 01 02 35" src="https://github.com/zed-industries/zed/assets/87859239/a319a5ea-54b7-4681-951d-130ea26aa390"> --------- Co-authored-by: Joseph T Lyons <JosephTLyons@gmail.com>
This commit is contained in:
parent
5ede48337c
commit
ba59e66314
@ -1,6 +1,25 @@
|
|||||||
|
(parameter (identifier) @variable)
|
||||||
(attribute attribute: (identifier) @property)
|
(attribute attribute: (identifier) @property)
|
||||||
(type (identifier) @type)
|
(type (identifier) @type)
|
||||||
|
|
||||||
|
; Module imports
|
||||||
|
|
||||||
|
(import_statement
|
||||||
|
(dotted_name (identifier) @type))
|
||||||
|
|
||||||
|
(import_statement
|
||||||
|
(aliased_import
|
||||||
|
name: (dotted_name (identifier) @type)
|
||||||
|
alias: (identifier) @type))
|
||||||
|
|
||||||
|
(import_from_statement
|
||||||
|
(dotted_name (identifier) @type))
|
||||||
|
|
||||||
|
(import_from_statement
|
||||||
|
(aliased_import
|
||||||
|
name: (dotted_name (identifier) @type)
|
||||||
|
alias: (identifier) @type))
|
||||||
|
|
||||||
; Function calls
|
; Function calls
|
||||||
|
|
||||||
(decorator) @function
|
(decorator) @function
|
||||||
@ -44,9 +63,13 @@
|
|||||||
(float)
|
(float)
|
||||||
] @number
|
] @number
|
||||||
|
|
||||||
; Variables
|
; Self references
|
||||||
(assignment
|
|
||||||
left: (identifier) @variable)
|
[
|
||||||
|
(parameters (identifier) @variable.special)
|
||||||
|
(attribute (identifier) @variable.special)
|
||||||
|
(#match? @variable.special "^self$")
|
||||||
|
]
|
||||||
|
|
||||||
(comment) @comment
|
(comment) @comment
|
||||||
(string) @string
|
(string) @string
|
||||||
|
Loading…
Reference in New Issue
Block a user