> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ubiquex.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Editor Setup

> Configure VS Code or Zed for XCL syntax highlighting and language support.

XCL editor support is available for VS Code/Cursor and Zed. Both extensions provide syntax highlighting for `.xcl` files. Language server (LSP) support is wired but not yet implemented — it fails gracefully with no effect.

## VS Code / Cursor

The ubx VS Code extension is in `editors/vscode/` in the ubx repository.

### Installing from source

```sh theme={"theme":"css-variables"}
cd editors/vscode
npm install
npm run build
npx vsce package
code --install-extension ubx-0.3.0.vsix
```

Or install the `.vsix` file through VS Code's Extensions panel: **Extensions → ⋯ → Install from VSIX…**

### What you get

* Syntax highlighting for `.xcl` files
* Language ID: `xcl`
* Keywords: `stack`, `input`, `output`, `locals`, `module`, `provider`, `space`, `root`, `import`, `for`, `when`, `match`, `default`, `as`, `optional`, `deprecated`
* `//` and `/* */` comment toggling
* `{` `}` `[` `]` `(` `)` bracket auto-close
* F-string interpolation highlighting (`f"..."` with `{expr}`)
* Cross-stack ref highlighting (`@stack.output`)
* Type keyword highlighting (`string`, `bool`, `number`, `int`, `any`, `list`, `set`, `map`, `tuple`, `object`, `optional`)

### Extension ID

Language ID: `xcl`
File extension: `.xcl`
Extension display name: `ubx - XCL Language`

## Zed

The ubx Zed extension is in `editors/zed/` in the ubx repository.

### Installing

Load the extension as a local dev extension:

1. Open Zed
2. **Zed → Extensions → Install Dev Extension…**
3. Select the `editors/zed/` directory

On first load, Zed compiles the XCL tree-sitter grammar (`grammars/xcl`) to a WASM module. This takes a few seconds.

### What you get

* Syntax highlighting via tree-sitter grammar
* Correct indentation (auto-indent on `{`, `[`, `)`)
* Bracket matching: `{ }` `[ ]` `( )`
* Outline panel: shows all top-level blocks (`stack`, `input`, `output`, `locals`, etc.) by name
* Doc comment highlighting (`///`)

### Tree-sitter grammar

The XCL grammar is at `grammars/xcl` (a git submodule pointing to `github.com/ubiquex/tree-sitter-xcl`). The grammar covers:

* All block types (`stack_body`, `input_block`, `output_block`, `locals_block`, etc.)
* Resource declarations (named and unnamed, with `for`/`when`/`* N`)
* All expression forms (binary, unary, ternary, match, f-string, heredoc, cross-stack ref)
* All type expressions (`list(T)`, `map(T)`, `object({...})`, `optional(T)`)

### Highlight queries

Semantic highlights in Zed use `languages/xcl/highlights.scm`. The query covers:

* `@keyword` — all XCL keywords
* `@type` — type keywords and named types
* `@operator` — `=`, `@`, comparison and arithmetic operators
* `@string` — string and heredoc literals
* `@number` — numeric literals
* `@boolean` — `true` / `false`
* `@constant.builtin` — `null`
* `@comment` — `//` and `/* */` comments
* `@comment.doc` — `///` doc comments
* `@punctuation.special` — f-string interpolation delimiters `{` `}`
* `@variable.special` — cross-stack ref sigil `@`

## Language Server (LSP)

Both extensions wire up an LSP server (`ubx lsp --stdio`), but the XCL language server is not yet implemented. The extension will start the server process but it currently does nothing beyond basic lifecycle management. Expect no LSP-powered features (completions, hover, go-to-definition) in the current version.
