Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set a default injection language for inline commands #141

Merged
merged 1 commit into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions queries-src/injections.scm
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@

(comment) @comment

; Default everything to be bash
; FIXME: uncomment this when we have a better idea of how precedence will work
; in all editors, since this is pretty turbulant in early 2024.
; (recipe_body
; (#set! injection.language "bash")
; (#set! injection.include-children)) @injection.content

(external_command
(command_body) @injection.content
(#set! injection.language "bash"))

; Set highlighting for recipes that set a language
(recipe_body
(shebang (language) @injection.language)
(#set! injection.include-children)) @injection.content

; Highlight the RHS of `=~` as regex
((regex_literal (_) @injection.content)
(#set! injection.language "regex"))

; Defaults if language is not set elsewhere

; (recipe_line
; (text) @injection.content
; (#set! injection.language "bash"))

; (external_command
; (command_body) @injection.content
; (#set! injection.language "bash"))
22 changes: 12 additions & 10 deletions queries/just/injections.scm
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,22 @@

(comment) @comment

; Default everything to be bash
; FIXME: uncomment this when we have a better idea of how precedence will work
; in all editors, since this is pretty turbulant in early 2024.
; (recipe_body
; (#set! injection.language "bash")
; (#set! injection.include-children)) @injection.content

(external_command
(command_body) @injection.content
(#set! injection.language "bash"))

; Set highlighting for recipes that set a language
(recipe_body
(shebang (language) @injection.language)
(#set! injection.include-children)) @injection.content

; Highlight the RHS of `=~` as regex
((regex_literal (_) @injection.content)
(#set! injection.language "regex"))

; Defaults if language is not set elsewhere

; (recipe_line
; (text) @injection.content
; (#set! injection.language "bash"))

; (external_command
; (command_body) @injection.content
; (#set! injection.language "bash"))
Loading