Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

python: Enhance syntax highlighting for type hints (#18185)

ClanEver188a893fd0c6
diff --git a/crates/languages/src/python/highlights.scm b/crates/languages/src/python/highlights.scm
index 5b646427712..e5f1b4d423b 100644
--- a/crates/languages/src/python/highlights.scm
+++ b/crates/languages/src/python/highlights.scm
@@ -1,5 +1,14 @@
(attribute attribute: (identifier) @property)
(type (identifier) @type)
+(generic_type (identifier) @type)
+
+; Type alias
+(type_alias_statement "type" @keyword)
+
+; TypeVar with constraints in type parameters
+(type
+ (tuple (identifier) @type)
+)
; Function calls