feat(ts): add jq
This commit is contained in:
@@ -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
|
||||
.
|
||||
|
||||
Reference in New Issue
Block a user