diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index ee01c40309c3a..12492ff86f1a0 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -157,6 +157,7 @@ | sshclientconfig | ✓ | | | | | starlark | ✓ | ✓ | | | | strace | ✓ | | | | +| supercollider | ✓ | | ✓ | | | svelte | ✓ | | ✓ | `svelteserver` | | sway | ✓ | ✓ | ✓ | `forc` | | swift | ✓ | | | `sourcekit-lsp` | diff --git a/languages.toml b/languages.toml index 1638cac496144..012499cf9471c 100644 --- a/languages.toml +++ b/languages.toml @@ -3027,3 +3027,15 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "hocon" source = { git = "https://github.com/antosha417/tree-sitter-hocon", rev = "c390f10519ae69fdb03b3e5764f5592fb6924bcc" } + +[[language]] +name = "supercollider" +scope = "source.supercollider" +injection-regex = "supercollider" +file-types = ["scd", "sc", "quark"] +comment-token = "//" +indent = { tab-width = 4, unit = "\t" } + +[[grammar]] +name = "supercollider" +source = { git = "https://github.com/madskjeldgaard/tree-sitter-supercollider", rev = "3b35bd0fded4423c8fb30e9585c7bacbcd0e8095" } diff --git a/runtime/queries/supercollider/folds.scm b/runtime/queries/supercollider/folds.scm new file mode 100644 index 0000000000000..214247bc0fb1c --- /dev/null +++ b/runtime/queries/supercollider/folds.scm @@ -0,0 +1,7 @@ +[ +(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 0000000000000..0128606de7474 --- /dev/null +++ b/runtime/queries/supercollider/highlights.scm @@ -0,0 +1,76 @@ +(line_comment) @comment.line +(block_comment) @comment.block + +(argument name: (identifier) @variable.parameter) + +(local_var name: (identifier) @variable) +(environment_var name:(identifier) @variable.builtin) +(builtin_var) @constant.builtin + +(function_definition name: (variable) @function) + +(named_argument name: (identifier) @variable.other.member) + +(method_call name: (method_name) @function.method) + +(class) @keyword.storage.type + +(number) @constant.numeric +(float) @constant.numeric.float + +(string) @string +(symbol) @string.special.symbol + +[ +"&&" +"||" +"&" +"|" +"^" +"==" +"!=" +"<" +"<=" +">" +">=" +"<<" +">>" +"+" +"-" +"*" +"/" +"%" +"=" +"|@|" +"@@" +"@|@" +] @operator + +[ +"arg" +"classvar" +"const" +"var" +] @keyword + +[ + "(" + ")" + "[" + "]" + "{" + "}" + "|" +] @punctuation.bracket + +[ + ";" + "." + "," +] @punctuation.delimiter + +(control_structure) @keyword.control.conditional + +(escape_sequence) @string.special + +(duplicated_statement) @keyword.control.repeat