feat: plugin code, updates

This commit is contained in:
2025-09-07 23:36:04 +03:00
parent 773f82e610
commit 4188c9221f
15 changed files with 354 additions and 11 deletions

View File

@@ -0,0 +1,40 @@
; Inject shell highlighting in function definitions
(function_definition
body: (compound_statement) @injection.content
(#set! injection.language "bash"))
; Inject shell in command substitutions
(command_substitution
"$(" @injection.punctuation.bracket
(_) @injection.content
(#set! injection.language "bash")
")" @injection.punctuation.bracket)
; Inject shell in When blocks with call/run
(simple_command
(command_name) @_when
(#eq? @_when "When")
(word) @_action
(#match? @_action "^(call|run)$")
(word)+ @injection.content
(#set! injection.language "bash"))
; Inject shell in arithmetic expressions
(arithmetic_expansion
"$((" @injection.punctuation.bracket
(_) @injection.content
(#set! injection.language "bash")
"))" @injection.punctuation.bracket)
; Inject shell in process substitution
(process_substitution
"<(" @injection.punctuation.bracket
(_) @injection.content
(#set! injection.language "bash")
")" @injection.punctuation.bracket)
(process_substitution
">(" @injection.punctuation.bracket
(_) @injection.content
(#set! injection.language "bash")
")" @injection.punctuation.bracket)