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: Improve docstring highlighting (#31628)

Finn Evers9cc1851be7aa
diff --git a/crates/languages/src/python/highlights.scm b/crates/languages/src/python/highlights.scm
index 02f1a57a883..97d5fb52755 100644
--- a/crates/languages/src/python/highlights.scm
+++ b/crates/languages/src/python/highlights.scm
@@ -151,6 +151,12 @@
"}" @punctuation.special) @embedded
; Docstrings.
+([
+ (expression_statement (assignment))
+ (type_alias_statement)
+]
+. (expression_statement (string) @string.doc)+)
+
(module
.(expression_statement (string) @string.doc)+)
@@ -173,13 +179,6 @@
. (comment) @comment*
. (expression_statement (string) @string.doc)+)
-(module
- [
- (expression_statement (assignment))
- (type_alias_statement)
- ]
- . (expression_statement (string) @string.doc)+)
-
(class_definition
body: (block
(expression_statement (assignment))