diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 033722987..90d77afb8 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -277,7 +277,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | @steelsojka [starlark](https://github.com/tree-sitter-grammars/tree-sitter-starlark) | unstable | `HFIJL` | @amaanq [strace](https://github.com/sigmaSd/tree-sitter-strace) | unstable | `H  J ` | @amaanq [styled](https://github.com/mskelton/tree-sitter-styled) | unstable | `HFIJ ` | @mskelton -[supercollider](https://github.com/madskjeldgaard/tree-sitter-supercollider) | unmaintained | `HFIJL` | @madskjeldgaard +[supercollider](https://github.com/madskjeldgaard/tree-sitter-supercollider) | unstable | `HFIJL` | @madskjeldgaard, @elgiano [superhtml](https://github.com/kristoff-it/superhtml) | unstable | `H  J ` | @rockorager [surface](https://github.com/connorlay/tree-sitter-surface) | unstable | `HFIJ ` | @connorlay [svelte](https://github.com/tree-sitter-grammars/tree-sitter-svelte) | unstable | `HFIJL` | @amaanq diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 39dc10687..4206c656a 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -2184,11 +2184,11 @@ return { }, supercollider = { install_info = { - revision = '76b3cab1773f08bb7d3a185420b0a44c6da8c294', + revision = 'e2d1480de0a62cd53f81645cb39bc1f3fa2dce5a', url = 'https://github.com/madskjeldgaard/tree-sitter-supercollider', }, - maintainers = { '@madskjeldgaard' }, - tier = 3, + maintainers = { '@madskjeldgaard', '@elgiano' }, + tier = 2, }, superhtml = { install_info = { diff --git a/runtime/queries/supercollider/folds.scm b/runtime/queries/supercollider/folds.scm index 2f5f1043a..a62272b5c 100644 --- a/runtime/queries/supercollider/folds.scm +++ b/runtime/queries/supercollider/folds.scm @@ -2,5 +2,4 @@ (function_call) (code_block) (function_block) - (control_structure) ] @fold diff --git a/runtime/queries/supercollider/highlights.scm b/runtime/queries/supercollider/highlights.scm index c56bce69a..bef85ef45 100644 --- a/runtime/queries/supercollider/highlights.scm +++ b/runtime/queries/supercollider/highlights.scm @@ -1,6 +1,6 @@ ; highlights.scm ; See this for full list: https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md -; comments +; Comments (line_comment) @comment @spell (block_comment) @comment @spell @@ -9,6 +9,12 @@ (argument name: (identifier) @variable.parameter) +"..." @variable.parameter ; variable argument + +; For function calls +(named_argument + name: (identifier) @variable.parameter) + ; Variables (local_var name: (identifier) @variable) @@ -18,31 +24,58 @@ (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) +(function_call + name: (_) @function.method.call) + +; Collections +(associative_item + (identifier) @property) ; Classes (class) @type +(parent_class) @type + +(instance_method_name) @function.method + +(class_method_name) @function.method + ; Literals +(bool) @boolean + (number) @number (float) @number.float (string) @string +(escape_sequence) @string.escape + (symbol) @string.special.symbol +; Conditionals +[ + "?" + "!?" + "??" +] @keyword.conditional + +((function_call + name: (_) @keyword.conditional) + (#any-of? @keyword.conditional "if" "while" "case" "switch" "try" "protect")) + +((function_call + name: (_) @keyword.repeat) + (#any-of? @keyword.repeat "for" "forBy")) + +; Duplication operator +"!" @keyword.repeat + ; Operators [ "&&" @@ -52,6 +85,8 @@ "^" "==" "!=" + "===" + "!==" "<" "<=" ">" @@ -64,6 +99,13 @@ "/" "%" "=" + "@" + "|@|" + "@@" + "@|@" + "++" + "+/+" + ".." ] @operator ; Keywords @@ -71,11 +113,13 @@ "arg" "classvar" "const" - ; "super" - ; "this" "var" ] @keyword +((local_var + name: (identifier) @variable.builtin) + (#any-of? @variable.builtin "this" "super")) + ; Brackets [ "(" @@ -92,12 +136,5 @@ ";" "." "," + ":" ] @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 index c0cffab3c..396721abf 100644 --- a/runtime/queries/supercollider/indents.scm +++ b/runtime/queries/supercollider/indents.scm @@ -12,21 +12,30 @@ (variable_definition) (variable_definition_sequence (variable_definition)) - (control_structure) (return_statement) ] @indent.begin [ (parameter_call_list - (argument_calls)) - "(" + (_)) ")" - "{" "}" - "[" "]" ] @indent.branch +; for auto-indent while typing +(ERROR + "{") @indent.begin + +(ERROR + "}") @indent.branch + +(ERROR + "[") @indent.begin + +(ERROR + "]") @indent.branch + [ (block_comment) (line_comment) diff --git a/runtime/queries/supercollider/locals.scm b/runtime/queries/supercollider/locals.scm index 066bbf9ab..b0a082131 100644 --- a/runtime/queries/supercollider/locals.scm +++ b/runtime/queries/supercollider/locals.scm @@ -3,7 +3,6 @@ (function_call) (code_block) (function_block) - (control_structure) ] @local.scope ; Definitions