Syntax highlighting + LSP integration (hover, go to definition, completion, rename, diagnostics) for the Peeper language.
- TextMate syntax highlighting for
.peepfiles - Language server integration using the compiler's built-in LSP (
peeper lsp, stdio JSON-RPC)- Hover info
- Go to definition
- Autocomplete
- Rename
- Publish diagnostics (errors/warnings as you type)
Named literals use Type.{ ... }; contextual literals remain .{ ... }.
Field initializers still use field = value:
Point.{ x = 1, y = 2 }
Box<i32>.{ value = 1 }
pkg::Point.{ x = 1, y = 2 }
Outer.{ child = Point.{ x = 1, y = 2 }, inferred = .{} }
pkg::Box<Box<i32>>.{ value = Box<i32>.{ value = 1 } }
Old named spelling .Point{ ... } is no longer valid. TextMate highlights
literal type heads (including nested generic arguments on one line); syntax
errors and semantic validation come from the installed compiler/LSP, which must
support the migrated syntax. Multiline literal bodies work; multiline generic
heads are not covered by this lexical rule. Autocomplete and snippets are unchanged.
The peeper binary must be available. Resolution order:
peeper.server.pathsetting (explicit path to binary)peeperonPATH
Build the compiler from the repo:
cd Peeper-main
go build -o build/bin/peeper ./cmd
# then either add build/bin to PATH or set "peeper.server.path" to its absolute path| Setting | Description |
|---|---|
peeper.server.path |
Absolute path to peeper binary. Empty = use peeper from PATH. |
peeper.server.trace |
Trace client/server communication (off / messages / verbose). |
Peeper: Restart Language Server
npm install
npm run compile
npm run test:grammar
# Optional: tokenize an additional Peeper source file with the same harness:
# node tm-test.mjs path/to/example.peep
# open this folder in VS Code, press F5 to launch Extension Development HostPackage a .vsix:
npx @vscode/vsce packageThe Zed extension (language-support/) uses tree-sitter grammars compiled to WASM and declares the language server via extension.toml; Zed spawns peeper lsp itself. VS Code cannot reuse the tree-sitter grammar directly, so highlighting here is a TextMate grammar (syntaxes/peeper.tmLanguage.json) derived from the same tree-sitter grammar and highlights.scm token categories. LSP integration uses the standard vscode-languageclient node SDK, which spawns the same peeper lsp stdio server.