-
Notifications
You must be signed in to change notification settings - Fork 0
Editor GoLand and JetBrains
GoLand and other JetBrains IDEs can participate in a Lexicon workflow today, but the current repository does not ship a JetBrains plugin.
There are two practical levels:
- Use CLI validation and generation from GoLand now.
- Build a JetBrains plugin wrapper for full
lexicon-lspcompletions and diagnostics.
JetBrains exposes LSP support through the IntelliJ Platform Plugin SDK. That means a plugin can launch lexicon-lsp, but users do not get a universal "attach any stdio LSP server" project setting equivalent to some editors.
swift build -c release --product lexicon
swift build -c release --product lexicon-generate
swift build -c release --product lexicon-lspKeep the absolute paths:
/absolute/path/to/Lexicon/.build/release/lexicon
/absolute/path/to/Lexicon/.build/release/lexicon-generate
/absolute/path/to/Lexicon/.build/release/lexicon-lsp
At the repository root:
{
"lexicon": "lexicons/commerce.lexicon"
}Save it as lexicon-lsp.json. This same file is used by Zed, VS Code clients, generic LSP clients, and a future JetBrains plugin.
Create external tools for validation and generation:
Validation command:
swift run lexicon lint lexicons/commerce.lexiconGeneration command:
swift run lexicon-generate lexicons/commerce.lexicon \
--type go \
--go-package commerce \
-o internal/commerce/lexiconThen run the generated Go code through normal GoLand inspections, go test, and go vet.
If you use a File Watcher or before-build step, prefer generation into a stable generated directory:
internal/commerce/lexicon.go
Avoid regenerating on every keystroke in a large vocabulary. Run generation on save, before tests, or in CI.
For completions inside:
l("commerce.api.order.submit")and diagnostics for unknown Lexicon paths, GoLand needs a JetBrains plugin that:
- registers
.lexiconfiles - starts
lexicon-lsp - attaches it to Lexicon and optionally Go/Rust files
- maps workspace roots to
lexicon-lsp.json - forwards document open/change/completion/diagnostic traffic
The IntelliJ Platform Plugin SDK documents LSP integration here:
https://plugins.jetbrains.com/docs/intellij/language-server-protocol.html
Until a Lexicon JetBrains plugin exists:
-
Use generated Go selectors for application code:
commerce.Commerce.Api.Order.Submit.ID()
-
Use
l("...")exact-path helpers sparingly, mostly in tests and migration data. -
Run
lexicon lintbefore commits. -
Run
lexicon-generatebefore Go tests or commit generated Go. -
Use Zed, VS Code with a client, or Neovim when authoring
.lexiconfiles needs live path completion.