{"id":20823029,"url":"https://github.com/madskjeldgaard/tree-sitter-supercollider","last_synced_at":"2026-03-12T00:33:36.842Z","repository":{"id":44716838,"uuid":"332790014","full_name":"madskjeldgaard/tree-sitter-supercollider","owner":"madskjeldgaard","description":"SuperCollider grammar for the tree-sitter code parser","archived":false,"fork":false,"pushed_at":"2026-02-20T14:58:54.000Z","size":5936,"stargazers_count":55,"open_issues_count":11,"forks_count":15,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-02-20T18:59:50.193Z","etag":null,"topics":["supercollider","tree-sitter","tree-sitter-parser","tree-sitter-supercollider"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/madskjeldgaard.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"custom":["https://ko-fi.com/madskjeldgaard"]}},"created_at":"2021-01-25T15:21:51.000Z","updated_at":"2026-02-20T14:58:57.000Z","dependencies_parsed_at":"2024-01-17T13:13:21.173Z","dependency_job_id":"573a2ca2-2962-45d1-8118-5e25bcaced4a","html_url":"https://github.com/madskjeldgaard/tree-sitter-supercollider","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/madskjeldgaard/tree-sitter-supercollider","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madskjeldgaard%2Ftree-sitter-supercollider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madskjeldgaard%2Ftree-sitter-supercollider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madskjeldgaard%2Ftree-sitter-supercollider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madskjeldgaard%2Ftree-sitter-supercollider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/madskjeldgaard","download_url":"https://codeload.github.com/madskjeldgaard/tree-sitter-supercollider/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madskjeldgaard%2Ftree-sitter-supercollider/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30408492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T22:36:59.286Z","status":"ssl_error","status_checked_at":"2026-03-11T22:36:57.544Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["supercollider","tree-sitter","tree-sitter-parser","tree-sitter-supercollider"],"created_at":"2024-11-17T22:17:04.836Z","updated_at":"2026-03-12T00:33:36.825Z","avatar_url":"https://github.com/madskjeldgaard.png","language":"C","funding_links":["https://ko-fi.com/madskjeldgaard"],"categories":[],"sub_categories":[],"readme":"[![Tree-sitter Test](https://github.com/madskjeldgaard/tree-sitter-supercollider/actions/workflows/ci.yml/badge.svg)](https://github.com/madskjeldgaard/tree-sitter-supercollider/actions/workflows/ci.yml)\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n**Table of Contents**  *generated with [DocToc](https://github.com/thlorenz/doctoc)*\n\n- [tree-sitter-supercollider](#tree-sitter-supercollider)\n  - [Contributing](#contributing)\n    - [Overview](#overview)\n    - [Resources](#resources)\n      - [Tree-sitter resources:](#tree-sitter-resources)\n      - [SuperCollider language resources:](#supercollider-language-resources)\n    - [Testing](#testing)\n  - [Status: Experimental but almost fully implemented](#status-experimental-but-almost-fully-implemented)\n  - [Features](#features)\n  - [Showcase:](#showcase)\n  - [Try it out](#try-it-out)\n  - [Trying with nvim-treesitter](#trying-with-nvim-treesitter)\n    - [Install locally in nvim](#install-locally-in-nvim)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n![live parsing of code](/assets/playground2.gif)\n_SuperCollider code (on the right) being parsed live by tree-sitter (on the left) using the nvim-playground plugin. Notice how quickly and incrementally it parses the code and includes the precise location of language features of the code_\n\n# tree-sitter-supercollider\n[SuperCollider](https://supercollider.github.io/) grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).\n\nSuperCollider is a programming language for sound. Tree-sitter is a really smart code parser.\n\nThis project defines a grammar (the \"rules\" of the language) for SuperCollider in a way that allows tree-sitter to do fast and very precise analysis of the code, while it is being typed.\n\nAmong other things, this allows for a very high level of precision in syntax highlighting (see below) and analyzing/traversing source code with equal precision.\n\n\n## Status: Experimental but almost fully implemented\nMost of sclang is now implemented, except for a few of the more esoteric things (see issues/todolist) and generally works well. Yet, it is still early days and so expect bugs and changes to happen.\n\n## Features\n\n- Scoped syntax highlighting (tree-sitter can tell the difference between local variables, environment variables and arguments inside of code blocks / functions)\n- Very precise error messages (if a node fails, tree-sitter can tell pretty easily where it failed and why - for example if you are missing a semi colon in the middle of a function)\n- Editor agnostic - tree-sitter grammars can be implemented in any editor via [tree-sitter's language bindings](https://tree-sitter.github.io/tree-sitter/using-parsers)\n\n## Showcase:\n\n**Syntax highlighting**\n\nSyntax highlighting a supercollider document in the terminal using the command `tree-sitter highlight \u003csomedocument\u003e.scd`:\n\n![screenshot of grammar in action2](/assets/benjolin.png)\n\n**Get table of contents for all definitions using [nvim-treesitter-refactor](https://github.com/nvim-treesitter/nvim-treesitter-refactor) and navigate the document using those:**\n\n![definitions](/assets/definitions.gif)\n\n**Rename all instances of a variable using [nvim-treesitter-refactor](https://github.com/nvim-treesitter/nvim-treesitter-refactor):**\n\n![smart rename](/assets/smartrename.gif)\n\n**Using [nvim-treesitter's playground to get a live view of the parser tree while writing code](https://github.com/nvim-treesitter/playground):**\n\n![playground](/assets/playground.gif)\n\n## Try it out\n\nSee node tree parsing in action\n```bash\ntree-sitter generate \u0026\u0026 tree-sitter parse example-file.scd\n```\nSee highlighting in action\n```bash\ntree-sitter generate \u0026\u0026 tree-sitter highlight example-file.scd\n```\n\n## Trying with nvim-treesitter\n\nInstall [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) to use this grammar with NeoVim and follow their instructions for installing grammars.\n\n### Install locally in nvim\nFor development purposes it may be helpful to install your supercollider grammar locally:\n\nAdd this to your nvim config (change path in `url` to that of the tree sitter supercollider repo on your system if it you've downloaded it somewhere):\n\n```lua\n-- tree-sitter-supercollider\nlocal parser_config = require \"nvim-treesitter.parsers\".get_parser_configs()\nparser_config.supercollider = {\n\tinstall_info = {\n\t\t-- url = \"~/code/tree-sitter-supercollider\",\n\t\turl = \"https://github.com/madskjeldgaard/tree-sitter-supercollider\",\n\t\tfiles = {\"src/parser.c\", \"src/scanner.c\"},\n\t\tmaintainer = \"@madskjeldgaard\"\n\t},\n\tfiletype = \"supercollider\", -- if filetype does not agrees with parser name\n}\n```\nAlso see nvim-treesitter [README](https://github.com/nvim-treesitter/nvim-treesitter#adding-parsers).\n\n## Contributing\nHelp WANTED. This project is too big to be handled by one person, and so any and all help would be appreciated.\n\nIf you want to help out, you can either identify and open up issues (example: Find some language feature that has not been defined in the grammar yet or some code that makes tree-sitter fail), resolve existing ones or write tests.\n\nPull requests are especially appreciated.\n\n### Overview\nThe source code is divided up like this:\n\n- **grammar.js** - This is where the syntax and grammar is defined.\n- **test/corpus/** - All unit tests sit here as .txt files\n- **queries/*.scm** - Syntax highlighting, code folding and indentation\n- **src/scanner.c** - A C file defining external scanners for more complex matching tasks\n\n### Resources\nHere are some helpful resources for developers who want to contribute:\n\n#### Tree-sitter resources:\n- [Creating parsers](https://tree-sitter.github.io/tree-sitter/creating-parsers) - The official tree-sitter documentation for creating parsers\n- [The javascript tree-sitter grammar is a good reference](https://github.com/tree-sitter/tree-sitter-javascript)\n- [A nice talk about what tree-sitter is and what it does](https://www.youtube.com/watch?v=Jes3bD6P0To)\n\n#### SuperCollider language resources:\nThere is no official spec for he SuperCollider language (hehe), but these links are somewhat helpful:\n- [Literals in SuperCollider](http://doc.sccode.org/Reference/Literals.html)\n- [Symbolic notation in SuperCollider](http://doc.sccode.org/Overviews/SymbolicNotations.html)\n- [Syntax shortcuts in SuperCollider](http://doc.sccode.org/Reference/Syntax-Shortcuts.html)\n- [the SCIDE lexer](https://github.com/supercollider/supercollider/blob/608bb981162c2c26f0a32c09d82557b29774a32e/editors/sc-ide/core/sc_lexer.cpp)\n\n### Testing\n\nIdeally, all rules in the grammar should be accompanied by at least one unit test.\n\nThese are found in `test/corpus` and named `\u003csubject\u003e.txt`. See [this part of the tree-sitter docs on how to create tests](https://tree-sitter.github.io/tree-sitter/creating-parsers#command-test).\n\nRun them like this:\n```bash\ntree-sitter generate \u0026\u0026 tree-sitter test\n```\n\nBefore pushing a pull request, make sure that it passes all tests.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadskjeldgaard%2Ftree-sitter-supercollider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadskjeldgaard%2Ftree-sitter-supercollider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadskjeldgaard%2Ftree-sitter-supercollider/lists"}