-
Notifications
You must be signed in to change notification settings - Fork 0
Editor Support
lexicon-lsp is a sidecar language server for Lexicon-aware completions and diagnostics.
It is intentionally small today. It supports:
- workspace initialization
- open/change document tracking
- completions
- diagnostics
- project configuration discovery
It does not currently provide hover, go-to-definition, rename, formatting, code actions, or semantic tokens.
The server builds an index from the composed live graph. That means it includes:
- imported lexicons
- node-level grafts
- inherited paths from types
- synonym paths
- connected root vocabulary
The editor sees the same graph that generation sees.
Lexicon document references:
submit:
+ commerce.type.boolean
active:
= enabled
selected:
? @ commerce.ui.checkout.button.primary
Go exact-path calls:
l("commerce.api.order.submit")Rust exact-path macros:
l!(commerce.api.order.submit)Diagnostics include:
- unknown Lexicon paths in supported reference contexts
- invalid Lexicon LSP configuration
- composition failures
- leading-space indentation in
.lexiconfiles
The indentation diagnostic matters because Lexicon hierarchy uses tabs. Spaces in leading indentation are ignored for hierarchy.
Put lexicon-lsp.json at the workspace root:
{
"lexicon": "lexicons/commerce.lexicon"
}For multiple independent roots:
{
"lexicons": [
{ "scope": "apps/storefront", "lexicon": "lexicons/storefront.lexicon" },
{ "scope": "packages/payments", "lexicon": "packages/payments/payments.lexicon" }
]
}The longest matching scope wins for each opened file.
Accepted configuration filenames:
lexicon-lsp.json.lexicon-lsp.jsonlexicon.conf.lexicon.conf
- Zed - currently the best-supported editor path because this repo includes a Zed dev extension.
- VS Code - use a thin language-client extension or a generic LSP client for experimentation.
- GoLand and JetBrains - CLI validation works now; full LSP requires a JetBrains plugin wrapper.
- Generic LSP Clients - Neovim, Helix, and other clients that can launch a stdio LSP server.
swift build -c release --product lexicon-lspUse the absolute path in editor configuration:
/absolute/path/to/Lexicon/.build/release/lexicon-lsp
Or put the binary on PATH:
cp .build/release/lexicon-lsp /usr/local/bin/lexicon-lspThese editor docs are useful when wiring lexicon-lsp into an editor: