Skip to content

Commit

Permalink
adds stable highlighting for combined jsdoc/comments syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
farwyler committed Jun 20, 2022
1 parent 257faa9 commit f545c11
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
13 changes: 8 additions & 5 deletions runtime/queries/javascript/injections.scm
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@
((regex_pattern) @injection.content
(#set! injection.language "regex"))

; Parse JSDoc annotations in comments
; Parse JSDoc annotations in multiline comments

((comment) @injection.content
(#set! injection.language "jsdoc"))
(#set! injection.language "jsdoc")
(#match? @injection.content "^/\\*+"))

; Parse comment tags (TODO, FIXME, ...)
; Parse general tags in single line comments

((comment) @injection.content
(#set! injection.language "comment")
(#match? @injection.content "^//"))

([(comment)] @injection.content
(#set! injection.language "comment"))
5 changes: 5 additions & 0 deletions runtime/queries/jsdoc/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; Parse general comment tags

((document) @injection.content
(#set! injection.include-children)
(#set! injection.language "comment"))

0 comments on commit f545c11

Please sign in to comment.