Zed extension

Official Zed extension for .pk template files and .pkc component files. A Tree-sitter grammar colours the source, and the pikopls language server adds template intelligence, the same server the VS Code and JetBrains plugins use.

Overview

The Tree-sitter grammar (tree-sitter-piko) colours the source. Embedded Go, JavaScript, TypeScript, CSS, and JSON each get coloured by their own grammar through Tree-sitter injections. A Go <script> block, a <style> block, and an <i18n> block each read in their native language.

Language intelligence comes from pikopls. The extension speaks LSP to that binary over stdio and surfaces completion, hover, go-to-definition, diagnostics, rename, code actions, document symbols, and folding. Because the three editors share one server, template intelligence matches across Zed, VS Code, and the JetBrains IDEs.

The extension compiles to a WebAssembly module. The Rust source in src/piko.rs locates the language server. It checks a path from your Zed settings first, then PATH, then a cached download. If it finds no binary, it downloads the matching prebuilt pikopls from the project's GitHub releases.

Requirements

  • Zed.
  • The pikopls binary on PATH, or network access so the extension can download the matching release binary on first use.
  • A Go toolchain on PATH. gopls type-checks the embedded Go block against your installed Go (set GOTOOLCHAIN=auto if go.mod requires a newer version).
  • gopls on PATH (go install golang.org/x/tools/gopls@latest) for Go-block intelligence. The Zed extension enables the gopls bridge automatically: it passes --gopls-bridge=true and --gopls-path (resolved from gopls on your worktree PATH). pikopls does not build Go features itself; it delegates them to gopls, the same gopls bridge the VS Code plugin uses. When gopls is not found the bridge disables itself, template and state intelligence keep working, and the Go block stays Tree-sitter highlighted only. See LSP setup for the full bridge behaviour.
  • A Rust toolchain with the wasm32-wasip2 target (rustup target add wasm32-wasip2), because Zed compiles the extension from source on a development install.

Installation

The extension is not on the Zed extension registry yet. Install it as a development extension from the repository.

First put pikopls on your PATH. The extension also downloads it automatically when it is absent.

make build-lsp
cp bin/lsp/pikopls /usr/local/bin/

go install piko.sh/piko/cmd/pikopls@latest also works and installs the binary as pikopls directly, which is the name the extension looks for.

Then install the extension in Zed. Open the command palette, run zed: install dev extension, and select the plugins/zed directory.

Configuration

The default setup needs no configuration. To point the extension at a specific binary, add an lsp block to Zed settings.json.

{
  "lsp": {
    "pikopls": {
      "binary": {
        "path": "/absolute/path/to/pikopls"
      }
    }
  }
}

pikopls runs over stdio, which is how Zed drives it, so it needs no transport flags.

See also

Sibling integrations:

  • VS Code, the VS Code-side equivalent.
  • IntelliJ IDEA, the JetBrains-side equivalent.
  • AI Agents, the documentation bundle that ships editor LSP config and Piko reference docs for AI assistants.

Framework docs: