feat(ts): add jq

This commit is contained in:
2026-05-29 11:29:45 +02:00
parent 482ed70cf6
commit 3e5cef568a
4 changed files with 229 additions and 0 deletions
+47
View File
@@ -65,6 +65,53 @@
(#set! injection.include-children)
(#set! injection.language "printf"))
; jq 'filter'
((command
name: (command_name) @_command
.
argument: [
(string)
(raw_string)
] @injection.content)
(#eq? @_command "jq")
(#offset! @injection.content 0 1 0 -1)
(#set! injection.include-children)
(#set! injection.language "jq"))
; jq -r 'filter'
((command
name: (command_name) @_command
argument: (word) @_arg
.
argument: [
(string)
(raw_string)
] @injection.content)
(#eq? @_command "jq")
(#any-of? @_arg "-c" "-e" "-r" "-M" "-R" "-s" "-n")
(#offset! @injection.content 0 1 0 -1)
(#set! injection.include-children)
(#set! injection.language "jq"))
; jq --arg name value 'filter'
((command
name: (command_name) @_command
argument: (word) @_arg
.
(_)
.
(_)
.
argument: [
(string)
(raw_string)
] @injection.content)
(#eq? @_command "jq")
(#any-of? @_arg "--arg" "--argjson" "--slurpfile" "--rawfile")
(#offset! @injection.content 0 1 0 -1)
(#set! injection.include-children)
(#set! injection.language "jq"))
((command
name: (command_name) @_command
.