Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial support for SuperCollider #9329

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions book/src/generated/lang-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@
| sshclientconfig | ✓ | | | |
| starlark | ✓ | ✓ | | |
| strace | ✓ | | | |
| supercollider | ✓ | | | |
| svelte | ✓ | | ✓ | `svelteserver` |
| sway | ✓ | ✓ | ✓ | `forc` |
| swift | ✓ | | | `sourcekit-lsp` |
Expand Down
12 changes: 12 additions & 0 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3328,3 +3328,15 @@ grammar = "hyprlang"
[[grammar]]
name = "hyprlang"
source = { git = "https://github.com/tree-sitter-grammars/tree-sitter-hyprlang", rev = "27af9b74acf89fa6bed4fb8cb8631994fcb2e6f3"}

[[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" }
7 changes: 7 additions & 0 deletions runtime/queries/supercollider/folds.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
(function_call)
(code_block)
(function_block)
(control_structure)
] @fold

76 changes: 76 additions & 0 deletions runtime/queries/supercollider/highlights.scm
Original file line number Diff line number Diff line change
@@ -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
Loading