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.

Highlight reference types directive in TypeScript (#11039)

d1yf72cf2afe34f
diff --git a/crates/languages/src/typescript/injections.scm b/crates/languages/src/typescript/injections.scm
index 0df1691e7e4..c09ff5ba579 100644
--- a/crates/languages/src/typescript/injections.scm
+++ b/crates/languages/src/typescript/injections.scm
@@ -1,5 +1,9 @@
((comment) @content
(#set! "language" "jsdoc"))
+(((comment) @reference
+ (#match? @reference "^///\\s+<reference\\s+types=\"\\S+\"\\s*/>\\s*$")) @content
+ (#set! "language" "html"))
+
((regex) @content
(#set! "language" "regex"))