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: Fix highlighting of built-in types for `isinstance` and `issubclass` (#30807)

Zsolt Cserna21fd1c8b8014
diff --git a/crates/languages/src/python/highlights.scm b/crates/languages/src/python/highlights.scm
index ffc1c5633cc..02f1a57a883 100644
--- a/crates/languages/src/python/highlights.scm
+++ b/crates/languages/src/python/highlights.scm
@@ -52,6 +52,20 @@
(function_definition
name: (identifier) @function.definition)
+((call
+ function: (identifier) @_isinstance
+ arguments: (argument_list
+ (_)
+ (identifier) @type))
+ (#eq? @_isinstance "isinstance"))
+
+((call
+ function: (identifier) @_issubclass
+ arguments: (argument_list
+ (identifier) @type
+ (identifier) @type))
+ (#eq? @_issubclass "issubclass"))
+
; Function arguments
(function_definition
parameters: (parameters