diff options
| author | Christian Clason <c.clason@uni-graz.at> | 2023-06-12 09:54:30 -0600 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2025-05-12 18:43:40 +0200 |
| commit | 692b051b09935653befdb8f7ba8afdb640adf17b (patch) | |
| tree | 167162b6b129ae04f68c5735078521a72917c742 /runtime/queries/supercollider | |
| parent | feat(c-family): inherit injections (diff) | |
| download | nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.gz nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.bz2 nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.lz nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.xz nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.zst nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.zip | |
feat!: drop modules, general refactor and cleanup
Diffstat (limited to 'runtime/queries/supercollider')
| -rw-r--r-- | runtime/queries/supercollider/folds.scm | 6 | ||||
| -rw-r--r-- | runtime/queries/supercollider/highlights.scm | 103 | ||||
| -rw-r--r-- | runtime/queries/supercollider/indents.scm | 33 | ||||
| -rw-r--r-- | runtime/queries/supercollider/injections.scm | 5 | ||||
| -rw-r--r-- | runtime/queries/supercollider/locals.scm | 29 |
5 files changed, 176 insertions, 0 deletions
diff --git a/runtime/queries/supercollider/folds.scm b/runtime/queries/supercollider/folds.scm new file mode 100644 index 000000000..2f5f1043a --- /dev/null +++ b/runtime/queries/supercollider/folds.scm @@ -0,0 +1,6 @@ +[ + (function_call) + (code_block) + (function_block) + (control_structure) +] @fold diff --git a/runtime/queries/supercollider/highlights.scm b/runtime/queries/supercollider/highlights.scm new file mode 100644 index 000000000..c56bce69a --- /dev/null +++ b/runtime/queries/supercollider/highlights.scm @@ -0,0 +1,103 @@ +; highlights.scm +; See this for full list: https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md +; comments +(line_comment) @comment @spell + +(block_comment) @comment @spell + +; Argument definition +(argument + name: (identifier) @variable.parameter) + +; Variables +(local_var + name: (identifier) @variable) + +(environment_var + name: (identifier) @variable.builtin) + +(builtin_var) @constant.builtin + +; (variable) @variable +; Functions +(function_definition + name: (variable) @function) + +; For function calls +(named_argument + name: (identifier) @function.call) + +; Methods +(method_call + name: (method_name) @function.method.call) + +; Classes +(class) @type + +; Literals +(number) @number + +(float) @number.float + +(string) @string + +(symbol) @string.special.symbol + +; Operators +[ + "&&" + "||" + "&" + "|" + "^" + "==" + "!=" + "<" + "<=" + ">" + ">=" + "<<" + ">>" + "+" + "-" + "*" + "/" + "%" + "=" +] @operator + +; Keywords +[ + "arg" + "classvar" + "const" + ; "super" + ; "this" + "var" +] @keyword + +; Brackets +[ + "(" + ")" + "[" + "]" + "{" + "}" + "|" +] @punctuation.bracket + +; Delimiters +[ + ";" + "." + "," +] @punctuation.delimiter + +; control structure +(control_structure) @keyword.conditional + +(escape_sequence) @string.escape + +; SinOsc.ar()!2 +(duplicated_statement) @keyword.repeat diff --git a/runtime/queries/supercollider/indents.scm b/runtime/queries/supercollider/indents.scm new file mode 100644 index 000000000..c0cffab3c --- /dev/null +++ b/runtime/queries/supercollider/indents.scm @@ -0,0 +1,33 @@ +[ + (function_block) + (binary_expression) + (collection) + (indexed_collection) + (parameter_call_list) + (function_call) + (class_def) + (classvar) + (const) + (instance_var) + (variable_definition) + (variable_definition_sequence + (variable_definition)) + (control_structure) + (return_statement) +] @indent.begin + +[ + (parameter_call_list + (argument_calls)) + "(" + ")" + "{" + "}" + "[" + "]" +] @indent.branch + +[ + (block_comment) + (line_comment) +] @indent.ignore diff --git a/runtime/queries/supercollider/injections.scm b/runtime/queries/supercollider/injections.scm new file mode 100644 index 000000000..3cd6aac8e --- /dev/null +++ b/runtime/queries/supercollider/injections.scm @@ -0,0 +1,5 @@ +([ + (line_comment) + (block_comment) +] @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/supercollider/locals.scm b/runtime/queries/supercollider/locals.scm new file mode 100644 index 000000000..066bbf9ab --- /dev/null +++ b/runtime/queries/supercollider/locals.scm @@ -0,0 +1,29 @@ +; Scopes +[ + (function_call) + (code_block) + (function_block) + (control_structure) +] @local.scope + +; Definitions +(argument + name: (identifier) @local.definition.parameter + (#set! definition.var.scope "local")) + +(variable_definition + name: (variable + (local_var + (identifier) @local.definition.var))) + +(variable_definition + name: (variable + (environment_var + (identifier) @local.definition.var)) + (#set! definition.var.scope "global")) + +(function_definition + name: (variable) @local.definition.var + (#set! definition.var.scope "parent")) + +(identifier) @local.reference |
