tree-sitter-d2/queries/injections.scm

49 lines
828 B
Scheme
Raw Normal View History

2022-12-09 18:21:55 +03:00
; for tree-sitter
(
2023-06-17 00:43:01 +03:00
(text_block . (raw_text) @injection.content)
2022-12-09 18:21:55 +03:00
(#set! injection.language "markdown")
)
(text_block
(language) @injection.language
(raw_text) @injection.content
)
2023-06-17 00:43:01 +03:00
(
(line_comment) @injection.content
(#set! @injection.language "comment")
)
(
(block_comment) @injection.content
(#set! @injection.language "comment")
)
;; -------------------------------------
2022-12-09 18:21:55 +03:00
;; overwrite for nvim-treesitter
; use markdown as default
(text_block . (raw_text) @markdown)
; add alias for markdown
(text_block
(language) @_language
(raw_text) @markdown
(#eq? @_language "md")
)
; add alias for javascript
(text_block
(language) @_language
(raw_text) @javascript
(#eq? @_language "js")
)
(text_block
(language) @language
(raw_text) @content
)
2022-12-10 03:51:39 +03:00
(line_comment) @comment
2023-06-17 00:43:01 +03:00
(block_comment) @comment