Skip to content

Commit

Permalink
Match against shebang
Browse files Browse the repository at this point in the history
Add the `first_line_match` header field to match against jq (+popular implementations of) in the shebang line, for scripts that don't have the `.jq` extension
  • Loading branch information
baodrate authored and zogwarg committed Dec 20, 2023
1 parent 18caba2 commit 1fea3fa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions JQ.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ file_extensions:
- jq
scope: source.jq

first_line_match: |-
(?xi:
^ \#! .* \b(jq|gojq|jaq|yq)\b # shebang
)
variables:
identifier_start: '[[:alpha:]_]'
identifier: '\b{{identifier_start}}[[:alnum:]_]*\b'
Expand Down

0 comments on commit 1fea3fa

Please sign in to comment.