Add comment language injection for supported languages (#39884)
Release Notes: - Added comment language injections for builtin languages. This enables highlighting of `TODO`s and similar notes with the comment extension installed. Signed-off-by: Donnie Adams <donnie@thedadams.com>
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
((comment) @injection.content
|
||||||
|
(#set! injection.language "comment")
|
||||||
|
)
|
||||||
@@ -1,3 +1,7 @@
|
|||||||
|
((comment) @injection.content
|
||||||
|
(#set! injection.language "comment")
|
||||||
|
)
|
||||||
|
|
||||||
(preproc_def
|
(preproc_def
|
||||||
value: (preproc_arg) @injection.content
|
value: (preproc_arg) @injection.content
|
||||||
(#set! injection.language "c"))
|
(#set! injection.language "c"))
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
((comment) @injection.content
|
||||||
|
(#set! injection.language "comment")
|
||||||
|
)
|
||||||
|
|
||||||
(preproc_def
|
(preproc_def
|
||||||
value: (preproc_arg) @injection.content
|
value: (preproc_arg) @injection.content
|
||||||
(#set! injection.language "c++"))
|
(#set! injection.language "c++"))
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
((comment) @content
|
||||||
|
(#set! injection.language "comment")
|
||||||
|
)
|
||||||
|
|
||||||
((scissors) @content
|
((scissors) @content
|
||||||
(#set! "language" "diff"))
|
(#set! "language" "diff"))
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
; Refer to https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/go/injections.scm#L4C1-L16C41
|
; Refer to https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/go/injections.scm#L4C1-L16C41
|
||||||
|
((comment) @injection.content
|
||||||
|
(#set! injection.language "comment")
|
||||||
|
)
|
||||||
|
|
||||||
(call_expression
|
(call_expression
|
||||||
(selector_expression) @_function
|
(selector_expression) @_function
|
||||||
(#any-of? @_function
|
(#any-of? @_function
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
((comment) @injection.content
|
||||||
|
(#set! injection.language "comment")
|
||||||
|
)
|
||||||
|
|
||||||
(((comment) @_jsdoc_comment
|
(((comment) @_jsdoc_comment
|
||||||
(#match? @_jsdoc_comment "(?s)^/[*][*][^*].*[*]/$")) @injection.content
|
(#match? @_jsdoc_comment "(?s)^/[*][*][^*].*[*]/$")) @injection.content
|
||||||
(#set! injection.language "jsdoc"))
|
(#set! injection.language "jsdoc"))
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
((comment) @injection.content
|
||||||
|
(#set! injection.language "comment")
|
||||||
|
)
|
||||||
@@ -1,3 +1,7 @@
|
|||||||
|
((comment) @injection.content
|
||||||
|
(#set! injection.language "comment")
|
||||||
|
)
|
||||||
|
|
||||||
(((comment) @_jsdoc_comment
|
(((comment) @_jsdoc_comment
|
||||||
(#match? @_jsdoc_comment "(?s)^/[*][*][^*].*[*]/$")) @injection.content
|
(#match? @_jsdoc_comment "(?s)^/[*][*][^*].*[*]/$")) @injection.content
|
||||||
(#set! injection.language "jsdoc"))
|
(#set! injection.language "jsdoc"))
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
((comment) @injection.content
|
||||||
|
(#set! injection.language "comment")
|
||||||
|
)
|
||||||
|
|
||||||
(((comment) @_jsdoc_comment
|
(((comment) @_jsdoc_comment
|
||||||
(#match? @_jsdoc_comment "(?s)^/[*][*][^*].*[*]/$")) @injection.content
|
(#match? @_jsdoc_comment "(?s)^/[*][*][^*].*[*]/$")) @injection.content
|
||||||
(#set! injection.language "jsdoc"))
|
(#set! injection.language "jsdoc"))
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
((comment) @injection.content
|
||||||
|
(#set! injection.language "comment")
|
||||||
|
)
|
||||||
@@ -1,3 +1,7 @@
|
|||||||
|
((comment) @injection.content
|
||||||
|
(#set! injection.language "comment")
|
||||||
|
)
|
||||||
|
|
||||||
(script_element
|
(script_element
|
||||||
(raw_text) @injection.content
|
(raw_text) @injection.content
|
||||||
(#set! injection.language "javascript"))
|
(#set! injection.language "javascript"))
|
||||||
|
|||||||
Reference in New Issue
Block a user