Zed syntax highlighting for Cerebras Software Language (CSL).
This extension is intentionally scoped to match the bundled Cerebras VS Code highlighter. It is not a complete CSL parser or language server.
.cslfile recognition asCSL.//line comments.- CSL keywords such as
const,var,fn,layout,task,if,else,for,while,return,struct, andcomptime. - CSL
@identifierbuiltins such as@import_module,@set_tile_code, and@range. - Primitive and storage-like types such as
i16,i32,u16,u32,f16,f32,bf16,cb16,bool,color,data_task_id, andcontrol_task_id. - Constants such as
true,false,EAST,WEST,NORTH,SOUTH, andRAMP. - Strings, character literals, escape sequences, numeric literals, operators, punctuation, bracket matching, and basic indentation.
- A CSL language server.
- Autocomplete, diagnostics, typechecking, go-to-definition, or semantic token support.
- A complete CSL parser. The grammar is lexical and block-aware so it can support highlighting at roughly the same level as the VS Code TextMate grammar.
The reference implementation is the Cerebras SDK VS Code highlighter:
csl.vscode/syntaxes/csl.tmLanguage.json
That file is a TextMate grammar. Zed does not consume TextMate grammars directly, so this extension translates the same token categories into a minimal Tree-sitter grammar plus Zed query files.
Clone the repo, then install it as a Zed development extension:
git clone https://github.com/ashxudev/zed-csl.gitIn Zed:
- Open the command palette.
- Run
zed: extensions. - Choose
Install Dev Extension. - Select the cloned
zed-cslfolder.
extension.toml
languages/csl/config.toml
languages/csl/highlights.scm
languages/csl/brackets.scm
languages/csl/indents.scm
tree-sitter-csl/
tree-sitter-csl/ is the bundled Tree-sitter grammar. extension.toml points
Zed at this same GitHub repo and uses path = "tree-sitter-csl" to locate the
grammar subfolder.
The grammar source lives in:
tree-sitter-csl/grammar.js
If you change the grammar, regenerate parser files with:
cd tree-sitter-csl
pnpm install
pnpm run generateThen commit the regenerated files and update the grammar rev in
extension.toml to the commit SHA that should be used for the grammar.