-
Notifications
You must be signed in to change notification settings - Fork 992
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
364 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
; File autogenerated by build-queries-nvim.py; do not edit | ||
|
||
; Define collapse points | ||
|
||
[ | ||
(recipe) | ||
(string) | ||
(external_command) | ||
] @fold | ||
(#trim! @fold) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
; File autogenerated by build-queries-nvim.py; do not edit | ||
|
||
; This file specifies how matched syntax patterns should be highlighted | ||
|
||
[ | ||
"export" | ||
"import" | ||
] @keyword.control.import | ||
|
||
"mod" @keyword.directive | ||
|
||
[ | ||
"alias" | ||
"set" | ||
"shell" | ||
] @keyword | ||
|
||
[ | ||
"if" | ||
"else" | ||
] @keyword.control.conditional | ||
|
||
; Variables | ||
|
||
(value | ||
(identifier) @variable) | ||
|
||
(alias | ||
left: (identifier) @variable) | ||
|
||
(assignment | ||
left: (identifier) @variable) | ||
|
||
; Functions | ||
|
||
(recipe_header | ||
name: (identifier) @function) | ||
|
||
(dependency | ||
name: (identifier) @function) | ||
|
||
(dependency_expression | ||
name: (identifier) @function) | ||
|
||
(function_call | ||
name: (identifier) @function) | ||
|
||
; Parameters | ||
|
||
(parameter | ||
name: (identifier) @variable.parameter) | ||
|
||
; Namespaces | ||
|
||
(module | ||
name: (identifier) @namespace) | ||
|
||
; Operators | ||
|
||
[ | ||
":=" | ||
"?" | ||
"==" | ||
"!=" | ||
"=~" | ||
"@" | ||
"=" | ||
"$" | ||
"*" | ||
"+" | ||
"&&" | ||
"@-" | ||
"-@" | ||
"-" | ||
"/" | ||
":" | ||
] @operator | ||
|
||
; Punctuation | ||
|
||
"," @punctuation.delimiter | ||
|
||
[ | ||
"{" | ||
"}" | ||
"[" | ||
"]" | ||
"(" | ||
")" | ||
"{{" | ||
"}}" | ||
] @punctuation.bracket | ||
|
||
[ "`" "```" ] @punctuation.special | ||
|
||
; Literals | ||
|
||
(boolean) @constant.builtin.boolean | ||
|
||
[ | ||
(string) | ||
(external_command) | ||
] @string | ||
|
||
(escape_sequence) @constant.character.escape | ||
|
||
; Comments | ||
|
||
(comment) @comment.line | ||
|
||
(shebang) @keyword.directive | ||
|
||
; highlight known settings (filtering does not always work) | ||
(setting | ||
left: (identifier) @keyword | ||
(#any-of? @keyword | ||
"allow-duplicate-recipes" | ||
"dotenv-filename" | ||
"dotenv-load" | ||
"dotenv-path" | ||
"export" | ||
"fallback" | ||
"ignore-comments" | ||
"positional-arguments" | ||
"shell" | ||
"tempdi" | ||
"windows-powershell" | ||
"windows-shell")) | ||
|
||
; highlight known attributes (filtering does not always work) | ||
(attribute | ||
(identifier) @attribute | ||
(#any-of? @attribute | ||
"private" | ||
"allow-duplicate-recipes" | ||
"dotenv-filename" | ||
"dotenv-load" | ||
"dotenv-path" | ||
"export" | ||
"fallback" | ||
"ignore-comments" | ||
"positional-arguments" | ||
"shell" | ||
"tempdi" | ||
"windows-powershell" | ||
"windows-shell")) | ||
|
||
; Numbers are part of the syntax tree, even if disallowed | ||
(numeric_error) @error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
; File autogenerated by build-queries-nvim.py; do not edit | ||
|
||
; This query specifies how to auto-indent logical blocks. | ||
; | ||
; Better documentation with diagrams is in https://docs.helix-editor.com/guides/indent.html | ||
|
||
[ | ||
(recipe) | ||
(string) | ||
(external_command) | ||
] @indent @extend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
; File autogenerated by build-queries-nvim.py; do not edit | ||
|
||
; Specify nested languages that live within a `justfile` | ||
|
||
; FIXME: these are not compatible with helix due to precedence | ||
|
||
; ================ Always applicable ================ | ||
|
||
((comment) @injection.content | ||
(#set! injection.language "comment")) | ||
|
||
; Highlight the RHS of `=~` as regex | ||
((regex_literal | ||
(_) @injection.content) | ||
(#set! injection.language "regex")) | ||
|
||
; ================ Global defaults ================ | ||
|
||
; Default everything to be bash | ||
(recipe_body | ||
(#set! injection.language "bash") | ||
(#set! injection.include-children)) @injection.content | ||
|
||
(external_command | ||
(command_body) @injection.content | ||
(#set! injection.language "bash")) | ||
|
||
; ================ Global language specified ================ | ||
; Global language is set with something like one of the following: | ||
; | ||
; set shell := ["bash", "-c", ...] | ||
; set shell := ["pwsh.exe"] | ||
; | ||
; We can extract the first item of the array, but we can't extract the language | ||
; name from the string with something like regex. So instead we special case | ||
; two things: powershell, which is likely to come with a `.exe` attachment that | ||
; we need to strip, and everything else which hopefully has no extension. We | ||
; separate this with a `#match?`. | ||
; | ||
; Unfortunately, there also isn't a way to allow arbitrary nesting or | ||
; alternatively set "global" capture variables. So we can set this for item- | ||
; level external commands, but not for e.g. external commands within an | ||
; expression without getting _really_ annoying. Should at least look fine since | ||
; they default to bash. Limitations... | ||
; See https://github.com/tree-sitter/tree-sitter/issues/880 for more on that. | ||
|
||
(source_file | ||
(setting "shell" ":=" "[" (string) @_langstr | ||
(#match? @_langstr ".*(powershell|pwsh|cmd).*") | ||
(#set! injection.language "powershell")) | ||
[ | ||
(recipe | ||
(recipe_body (#set! injection.include-children)) @injection.content) | ||
|
||
(assignment | ||
(expression | ||
(value | ||
(external_command | ||
(command_body) @injection.content)))) | ||
]) | ||
|
||
(source_file | ||
(setting "shell" ":=" "[" (string) @injection.language | ||
(#not-match? @injection.language ".*(powershell|pwsh|cmd).*")) | ||
[ | ||
(recipe | ||
(recipe_body | ||
(#set! injection.include-children)) @injection.content) | ||
|
||
(assignment | ||
(expression | ||
(value | ||
(external_command | ||
(command_body) @injection.content)))) | ||
]) | ||
|
||
; ================ Recipe language specified ================ | ||
|
||
; Set highlighting for recipes that specify a language, using the exact name by default | ||
(recipe_body ; | ||
(shebang ; | ||
(language) @injection.language) ; | ||
(#not-any-of? @injection.language "python3" "nodejs" "node") | ||
(#set! injection.include-children)) @injection.content | ||
|
||
; Transform some known executables | ||
|
||
; python3 -> python | ||
(recipe_body | ||
(shebang | ||
(language) @_lang) | ||
(#eq? @_lang "python3") | ||
(#set! injection.language "python") | ||
(#set! injection.include-children)) @injection.content | ||
|
||
; node/nodejs -> javascript | ||
(recipe_body | ||
(shebang | ||
(language) @_lang) | ||
(#any-of? @_lang "node" "nodejs") | ||
(#set! injection.language "javascript") | ||
(#set! injection.include-children)) @injection.content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
; File autogenerated by build-queries-nvim.py; do not edit | ||
|
||
; This file tells us about the scope of variables so e.g. local | ||
; variables override global functions with the same name | ||
|
||
; Scope | ||
|
||
(recipe) @local.scope | ||
|
||
; Definitions | ||
|
||
(alias | ||
left: (identifier) @local.definition.variable) | ||
|
||
(assignment | ||
left: (identifier) @local.definition.variable) | ||
|
||
(module | ||
name: (identifier) @local.definition.namespace) | ||
|
||
(parameter | ||
name: (identifier) @local.definition.variable) | ||
|
||
(recipe_header | ||
name: (identifier) @local.definition.function) | ||
|
||
; References | ||
|
||
(alias | ||
right: (identifier) @local.reference) | ||
|
||
(function_call | ||
name: (identifier) @local.reference) | ||
|
||
(dependency | ||
name: (identifier) @local.reference) | ||
|
||
(dependency_expression | ||
name: (identifier) @local.reference) | ||
|
||
(value | ||
(identifier) @local.reference) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
; File autogenerated by build-queries-nvim.py; do not edit | ||
|
||
; Specify how to navigate around logical blocks in code | ||
|
||
(recipe | ||
(recipe_body) @function.inside) @function.around | ||
|
||
(parameters | ||
((_) @parameter.inside . ","? @parameter.around)) @parameter.around | ||
|
||
(dependency_expression | ||
(_) @parameter.inside) @parameter.around | ||
|
||
(function_call | ||
arguments: (sequence | ||
(expression) @parameter.inside) @parameter.around) @function.around | ||
|
||
(comment) @comment.around |
Oops, something went wrong.