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.

Expose Python docstrings for syntax highlighting (#7587)

Marshall Bowersbde509fa749d
diff --git a/crates/zed/src/languages/python/highlights.scm b/crates/zed/src/languages/python/highlights.scm
index 71ab963d826..0d85c8b6a93 100644
--- a/crates/zed/src/languages/python/highlights.scm
+++ b/crates/zed/src/languages/python/highlights.scm
@@ -52,6 +52,14 @@
"{" @punctuation.special
"}" @punctuation.special) @embedded
+; Docstrings.
+(function_definition
+ "async"?
+ "def"
+ name: (_)
+ (parameters)?
+ body: (block (expression_statement (string) @string.doc)))
+
[
"-"
"-="
@@ -122,4 +130,4 @@
"yield"
"match"
"case"
-] @keyword
\ No newline at end of file
+] @keyword