mirror of
https://github.com/ivuorinen/shellspec-zed.git
synced 2026-02-10 17:50:21 +00:00
feat: plugin code, updates
This commit is contained in:
40
languages/shellspec/injections.scm
Normal file
40
languages/shellspec/injections.scm
Normal 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)
|
||||
Reference in New Issue
Block a user