summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSantos Gallegos <stsewd@protonmail.com>2021-03-27 10:51:16 -0500
committerGitHub <noreply@github.com>2021-03-27 10:51:16 -0500
commit0df7c4aa39a6097e112f001520d2cea257440ed7 (patch)
tree64743ee563e3f59a975c535df1807d86b164d1ca
parentedcac596cefac86714af75caf073dda689478ee9 (diff)
Fix jsdoc: play nice with the comment parser (#1108)
Using separate queries makes it work as expected. Also, for the comment parser to be able to override the other tokens we need to remove the comment from highlights (this shouldn't be a problem since that section is already highlighted as a comment). And, the order of the captures matter, having jsdoc first will have more priority over `@param`. Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/1069
-rw-r--r--queries/ecma/injections.scm3
-rw-r--r--queries/jsdoc/highlights.scm1
2 files changed, 2 insertions, 2 deletions
diff --git a/queries/ecma/injections.scm b/queries/ecma/injections.scm
index 396a6b6b..bfa6318b 100644
--- a/queries/ecma/injections.scm
+++ b/queries/ecma/injections.scm
@@ -1,4 +1,5 @@
-((comment) @comment @jsdoc)
+(comment) @jsdoc
+(comment) @comment
((regex_pattern) @regex)
diff --git a/queries/jsdoc/highlights.scm b/queries/jsdoc/highlights.scm
index 57d393d7..4b4266c9 100644
--- a/queries/jsdoc/highlights.scm
+++ b/queries/jsdoc/highlights.scm
@@ -1,3 +1,2 @@
-(_) @comment
(tag_name) @keyword
(type) @type