A lightweight Zed extension that adds CoffeeScript support:
- Syntax highlighting via a Tree‑sitter CoffeeScript grammar
- LSP features (completion, hover, diagnostics, etc.) via CoffeeSense
- Zed editor
- Node.js and npm (for running the CoffeeSense language server via
npx) - Rust toolchain (only needed when you build the extension locally)
This extension runs CoffeeSense through npx so contributors don’t need a global install.
Configured in extension.toml:
[language_servers.coffeesense]
name = "CoffeeSense"
languages = ["CoffeeScript"]
command = "npx"
args = ["-y", "coffeesense-language-server@latest", "--stdio"]-yaccepts prompts; first run may download the package.- You can pin a version for stability, e.g.
"coffeesense-language-server@1.x". - If
npxis not on Zed’s PATH, setcommand = "/usr/bin/env"andargs = ["npx", ...].
The grammar is defined in extension.toml under [grammars.coffeescript].
It requires a Tree-sitter CoffeeScript grammar repository tree-sitter-coffeescript.
To have syntax highlighting and parsing work you need to clone the grammar locally or point to a public repo. Currently it points to a local checkout path.
Clone the Tree-sitter CoffeeScript grammar and set the local path in extension.toml:
[grammars.coffeescript]
repository = "file:///path/to/your/tree-sitter-coffeescript"
rev = "[latest commit hash]"After public release this will be updated to use a public repo URL pinned rev, for example:
[grammars.coffeescript]
repository = "<git URL to your tree-sitter-coffeescript>"
rev = "<pinned commit>"- Open Zed and use the command palette: “Extensions: Install Dev Extension”. Choose
coffeescript-zedfolder and Zed will build and load the extension from source. - Or build manually with Rust (Zed will still handle loading the built artifact when installing the dev extension):
cargo build --release
- CoffeeSense doesn’t start: ensure
npxis on PATH for Zed. Try settingcommand = "/usr/bin/env"andargs = ["npx", ...]as noted above. - First-run is slow:
npxmay download CoffeeSense on first use; subsequent runs are cached. - Grammar not loading on another machine: point
[grammars.coffeescript]to a public repo/commit, or vendor the precompiledcoffeescript.wasmas described.
Zed extension development docs: https://zed.dev/docs/extensions/developing-extensions