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: Highlight docstrings for classes and modules (#20486)

Carroll Wainwright20bffaf93f35
diff --git a/crates/languages/src/python/highlights.scm b/crates/languages/src/python/highlights.scm
index 6c3f027c197..98ed2039695 100644
--- a/crates/languages/src/python/highlights.scm
+++ b/crates/languages/src/python/highlights.scm
@@ -96,7 +96,16 @@
"def"
name: (_)
(parameters)?
- body: (block (expression_statement (string) @string.doc)))
+ body: (block . (expression_statement (string) @string.doc)))
+
+(class_definition
+ body: (block
+ . (comment) @comment*
+ . (expression_statement (string) @string.doc)))
+
+(module
+ . (comment) @comment*
+ . (expression_statement (string) @string.doc))
(module
(expression_statement (assignment))