diff options
author | VuiMuich | 2023-04-14 15:03:21 +0000 |
---|---|---|
committer | GitHub | 2023-04-14 15:03:21 +0000 |
commit | 4cdba7cccdd6a9fe5fbb3d15c9db3edc147b7a90 (patch) | |
tree | fcf47d2c5aab01d6c845f19107d8f4f486e0d359 /runtime/queries | |
parent | 896404c7ead29c4c19564581ccb53b913440a583 (diff) |
Add standalone language support for `just` (#6453)
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
Diffstat (limited to 'runtime/queries')
-rw-r--r-- | runtime/queries/just/folds.scm | 4 | ||||
-rw-r--r-- | runtime/queries/just/highlights.scm | 33 | ||||
-rw-r--r-- | runtime/queries/just/indents.scm | 3 | ||||
-rw-r--r-- | runtime/queries/just/injections.scm | 16 | ||||
-rw-r--r-- | runtime/queries/just/locals.scm | 10 | ||||
-rw-r--r-- | runtime/queries/just/textobjects.scm | 48 |
6 files changed, 114 insertions, 0 deletions
diff --git a/runtime/queries/just/folds.scm b/runtime/queries/just/folds.scm new file mode 100644 index 00000000..6fc68fbd --- /dev/null +++ b/runtime/queries/just/folds.scm @@ -0,0 +1,4 @@ +(body) @fold +(recipe) @fold +(interpolation) @fold +(item (_) @fold) diff --git a/runtime/queries/just/highlights.scm b/runtime/queries/just/highlights.scm new file mode 100644 index 00000000..1026f654 --- /dev/null +++ b/runtime/queries/just/highlights.scm @@ -0,0 +1,33 @@ +(assignment (NAME) @variable) +(alias (NAME) @variable) +(value (NAME) @variable) +(parameter (NAME) @variable) +(setting (NAME) @keyword) +(setting "shell" @keyword) + +(call (NAME) @function) +(dependency (NAME) @function) +(depcall (NAME) @function) +(recipeheader (NAME) @function) + +(depcall (expression) @variable.parameter) +(parameter) @variable.parameter +(variadic_parameters) @variable.parameter + +["if" "else"] @keyword.control.conditional + +(string) @string + +(boolean ["true" "false"]) @constant.builtin.boolean + +(comment) @comment + +; (interpolation) @string + +(shebang interpreter:(TEXT) @keyword ) @comment + +["export" "alias" "set"] @keyword + +["@" "==" "!=" "+" ":="] @operator + +[ "(" ")" "[" "]" "{{" "}}" "{" "}"] @punctuation.bracket diff --git a/runtime/queries/just/indents.scm b/runtime/queries/just/indents.scm new file mode 100644 index 00000000..3db59746 --- /dev/null +++ b/runtime/queries/just/indents.scm @@ -0,0 +1,3 @@ +[ + (recipe_body) +] @indent diff --git a/runtime/queries/just/injections.scm b/runtime/queries/just/injections.scm new file mode 100644 index 00000000..cae1035a --- /dev/null +++ b/runtime/queries/just/injections.scm @@ -0,0 +1,16 @@ +((comment) @injection.content + (#set! injection.language "comment")) + +(shebang_recipe + (shebang + interpreter:(TEXT) @injection.language) + (shebang_body) @injection.content +) + +(source_file + (item (setting lang:(NAME) @injection.language)) + (item (recipe (body (recipe_body) @injection.content))) +) + +; ((interpolation (expression) @injection.content) +; (#set! injection.language "just")) diff --git a/runtime/queries/just/locals.scm b/runtime/queries/just/locals.scm new file mode 100644 index 00000000..18e162a9 --- /dev/null +++ b/runtime/queries/just/locals.scm @@ -0,0 +1,10 @@ +(assignment (NAME) @local.definition) +(alias left:(NAME) @local.definition) +(alias right:(NAME) @local.reference) +(value (NAME) @local.reference) +(parameter (NAME) @local.definition) + +(call (NAME) @local.reference) +(dependency (NAME) @local.reference) +(depcall (NAME) @local.reference) +(recipeheader (NAME) @local.definition) diff --git a/runtime/queries/just/textobjects.scm b/runtime/queries/just/textobjects.scm new file mode 100644 index 00000000..4be37958 --- /dev/null +++ b/runtime/queries/just/textobjects.scm @@ -0,0 +1,48 @@ +(body) @function.inside +(recipe) @function.around +(expression + if:(expression) @function.inside +) +(expression + else:(expression) @function.inside +) +(interpolation (expression) @function.inside) @function.around +(settinglist (stringlist) @function.inside) @function.around + +(call (NAME) @class.inside) @class.around +(dependency (NAME) @class.inside) @class.around +(depcall (NAME) @class.inside) + +(dependency) @parameter.around +(depcall) @parameter.inside +(depcall (expression) @parameter.inside) + +(stringlist + (string) @parameter.inside + . ","? @_end + ; Commented out since we don't support `#make-range!` at the moment + ; (#make-range! "parameter.around" @parameter.inside @_end) +) +(parameters + [(parameter) + (variadic_parameters)] @parameter.inside + . " "? @_end + ; Commented out since we don't support `#make-range!` at the moment + ; (#make-range! "parameter.around" @parameter.inside @_end) +) + +(expression + (condition) @function.inside +) @function.around +(expression + if:(expression) @function.inside +) +(expression + else:(expression) @function.inside +) + +(item [(alias) (assignment) (export) (setting)]) @class.around +(recipeheader) @class.around +(line) @class.around + +(comment) @comment.around |