mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-12 00:10:04 -04:00
chore(injections)!: update injection syntax to 0.9
Since 0.9, @lang syntax is still available as fallback but will soon be deprecated. Because of that, new syntax should be adopted once 0.9 becomes the baseline requirements for nvim-treesitter - update health check - update doc
This commit is contained in:
parent
2aa9e9b0e6
commit
78b54eb7f6
140 changed files with 1083 additions and 665 deletions
|
|
@ -1,19 +1,24 @@
|
|||
(comment) @comment
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
||||
(apply_expression
|
||||
function: (_) @_func
|
||||
argument: [
|
||||
(string_expression (string_fragment) @regex)
|
||||
(indented_string_expression (string_fragment) @regex)
|
||||
(string_expression
|
||||
((string_fragment) @injection.content (#set! injection.language "regex")))
|
||||
(indented_string_expression
|
||||
((string_fragment) @injection.content (#set! injection.language "regex")))
|
||||
]
|
||||
(#match? @_func "(^|\\.)match$"))
|
||||
@combined
|
||||
(#match? @_func "(^|\\.)match$")
|
||||
(#set! injection.combined))
|
||||
|
||||
(binding
|
||||
attrpath: (attrpath (identifier) @_path)
|
||||
expression: [
|
||||
(string_expression (string_fragment) @bash)
|
||||
(indented_string_expression (string_fragment) @bash)
|
||||
(string_expression
|
||||
((string_fragment) @injection.content (#set! injection.language "bash")))
|
||||
(indented_string_expression
|
||||
((string_fragment) @injection.content (#set! injection.language "bash")))
|
||||
]
|
||||
(#match? @_path "(^\\w+(Phase|Hook)|(pre|post)[A-Z]\\w+|script)$"))
|
||||
|
||||
|
|
@ -22,87 +27,105 @@
|
|||
argument: (_ (_)* (_ (_)* (binding
|
||||
attrpath: (attrpath (identifier) @_path)
|
||||
expression: [
|
||||
(string_expression (string_fragment) @bash)
|
||||
(indented_string_expression (string_fragment) @bash)
|
||||
(string_expression
|
||||
((string_fragment) @injection.content (#set! injection.language "bash")))
|
||||
(indented_string_expression
|
||||
((string_fragment) @injection.content (#set! injection.language "bash")))
|
||||
])))
|
||||
(#match? @_func "(^|\\.)writeShellApplication$")
|
||||
(#match? @_path "^text$"))
|
||||
@combined
|
||||
(#match? @_path "^text$")
|
||||
(#set! injection.combined))
|
||||
|
||||
(apply_expression
|
||||
function: (apply_expression
|
||||
function: (apply_expression function: (_) @_func))
|
||||
argument: [
|
||||
(string_expression (string_fragment) @bash)
|
||||
(indented_string_expression (string_fragment) @bash)
|
||||
(string_expression
|
||||
((string_fragment) @injection.content (#set! injection.language "bash")))
|
||||
(indented_string_expression
|
||||
((string_fragment) @injection.content (#set! injection.language "bash")))
|
||||
]
|
||||
(#match? @_func "(^|\\.)runCommand((No)?CC)?(Local)?$"))
|
||||
@combined
|
||||
(#match? @_func "(^|\\.)runCommand((No)?CC)?(Local)?$")
|
||||
(#set! injection.combined))
|
||||
|
||||
((apply_expression
|
||||
function: (apply_expression function: (_) @_func)
|
||||
argument: [
|
||||
(string_expression (string_fragment) @bash)
|
||||
(indented_string_expression (string_fragment) @bash)
|
||||
(string_expression
|
||||
((string_fragment) @injection.content (#set! injection.language "bash")))
|
||||
(indented_string_expression
|
||||
((string_fragment) @injection.content (#set! injection.language "bash")))
|
||||
])
|
||||
(#match? @_func "(^|\\.)write(Bash|Dash|ShellScript)(Bin)?$"))
|
||||
@combined
|
||||
(#match? @_func "(^|\\.)write(Bash|Dash|ShellScript)(Bin)?$")
|
||||
(#set! injection.combined))
|
||||
|
||||
((apply_expression
|
||||
function: (apply_expression function: (_) @_func)
|
||||
argument: [
|
||||
(string_expression (string_fragment) @fish)
|
||||
(indented_string_expression (string_fragment) @fish)
|
||||
(string_expression
|
||||
((string_fragment) @injection.content (#set! injection.language "fish")))
|
||||
(indented_string_expression
|
||||
((string_fragment) @injection.content (#set! injection.language "fish")))
|
||||
])
|
||||
(#match? @_func "(^|\\.)writeFish(Bin)?$"))
|
||||
@combined
|
||||
(#match? @_func "(^|\\.)writeFish(Bin)?$")
|
||||
(#set! injection.combined))
|
||||
|
||||
((apply_expression
|
||||
function: (apply_expression
|
||||
function: (apply_expression function: (_) @_func))
|
||||
argument: [
|
||||
(string_expression (string_fragment) @haskell)
|
||||
(indented_string_expression (string_fragment) @haskell)
|
||||
(string_expression
|
||||
((string_fragment) @injection.content (#set! injection.language "haskell")))
|
||||
(indented_string_expression
|
||||
((string_fragment) @injection.content (#set! injection.language "haskell")))
|
||||
])
|
||||
(#match? @_func "(^|\\.)writeHaskell(Bin)?$"))
|
||||
@combined
|
||||
(#match? @_func "(^|\\.)writeHaskell(Bin)?$")
|
||||
(#set! injection.combined))
|
||||
|
||||
((apply_expression
|
||||
function: (apply_expression
|
||||
function: (apply_expression function: (_) @_func))
|
||||
argument: [
|
||||
(string_expression (string_fragment) @javascript)
|
||||
(indented_string_expression (string_fragment) @javascript)
|
||||
(string_expression
|
||||
((string_fragment) @injection.content (#set! injection.language "javascript")))
|
||||
(indented_string_expression
|
||||
((string_fragment) @injection.content (#set! injection.language "javascript")))
|
||||
])
|
||||
(#match? @_func "(^|\\.)writeJS(Bin)?$"))
|
||||
@combined
|
||||
(#match? @_func "(^|\\.)writeJS(Bin)?$")
|
||||
(#set! injection.combined))
|
||||
|
||||
((apply_expression
|
||||
function: (apply_expression
|
||||
function: (apply_expression function: (_) @_func))
|
||||
argument: [
|
||||
(string_expression (string_fragment) @perl)
|
||||
(indented_string_expression (string_fragment) @perl)
|
||||
(string_expression
|
||||
((string_fragment) @injection.content (#set! injection.language "perl")))
|
||||
(indented_string_expression
|
||||
((string_fragment) @injection.content (#set! injection.language "perl")))
|
||||
])
|
||||
(#match? @_func "(^|\\.)writePerl(Bin)?$"))
|
||||
@combined
|
||||
(#match? @_func "(^|\\.)writePerl(Bin)?$")
|
||||
(#set! injection.combined))
|
||||
|
||||
((apply_expression
|
||||
function: (apply_expression
|
||||
function: (apply_expression function: (_) @_func))
|
||||
argument: [
|
||||
(string_expression (string_fragment) @python)
|
||||
(indented_string_expression (string_fragment) @python)
|
||||
(string_expression
|
||||
((string_fragment) @injection.content (#set! injection.language "python")))
|
||||
(indented_string_expression
|
||||
((string_fragment) @injection.content (#set! injection.language "python")))
|
||||
])
|
||||
(#match? @_func "(^|\\.)write(PyPy|Python)[23](Bin)?$"))
|
||||
@combined
|
||||
(#match? @_func "(^|\\.)write(PyPy|Python)[23](Bin)?$")
|
||||
(#set! injection.combined))
|
||||
|
||||
((apply_expression
|
||||
function: (apply_expression
|
||||
function: (apply_expression function: (_) @_func))
|
||||
argument: [
|
||||
(string_expression (string_fragment) @rust)
|
||||
(indented_string_expression (string_fragment) @rust)
|
||||
(string_expression
|
||||
((string_fragment) @injection.content (#set! injection.language "rust")))
|
||||
(indented_string_expression
|
||||
((string_fragment) @injection.content (#set! injection.language "rust")))
|
||||
])
|
||||
(#match? @_func "(^|\\.)writeRust(Bin)?$"))
|
||||
@combined
|
||||
(#match? @_func "(^|\\.)writeRust(Bin)?$")
|
||||
(#set! injection.combined))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue