nvim-treesitter/queries/julia/injections.scm

41 lines
1 KiB
Scheme
Raw Normal View History

2024-01-06 15:05:50 +09:00
; Inject markdown in docstrings
((string_literal) @injection.content
2024-01-06 15:05:50 +09:00
.
[
(module_definition)
(abstract_definition)
(struct_definition)
(function_definition)
(macro_definition)
(assignment)
2023-07-05 18:14:04 -05:00
(const_statement)
]
2024-01-06 15:05:50 +09:00
(#lua-match? @injection.content "^\"\"\"")
(#set! injection.language "markdown")
(#offset! @injection.content 0 3 0 -3))
; Inject comments
([
(line_comment)
(block_comment)
2024-01-06 15:05:50 +09:00
] @injection.content
(#set! injection.language "comment"))
2022-11-26 14:27:21 +02:00
; Inject regex in r"hello\bworld"
2022-11-26 14:27:21 +02:00
((prefixed_string_literal
2024-01-06 15:05:50 +09:00
prefix: (identifier) @_prefix) @injection.content
(#eq? @_prefix "r")
(#set! injection.language "regex")
(#offset! @injection.content 0 2 0 -1))
; Inject markdown in md"**Bold** and _Italics_"
((prefixed_string_literal
prefix: (identifier) @_prefix) @injection.content
(#eq? @_prefix "md")
(#set! injection.language "markdown")
(#offset! @injection.content 0 3 0 -1))
; Inject bash in `git add --help`
((command_literal) @injection.content
(#set! injection.language "bash"))