The wiki at https://github.com/cue-lang/cue/wiki/LSP:-Getting-started is a good on-ramp, but there are two concrete gaps worth addressing:
1. cue lsp should no longer be hidden
cmd/cue/cmd/lsp.go:29 still marks the subcommand as Hidden: true. Given the feature set below is real and user-facing, it's probably time to unhide it (and flesh out the TODO(myitcv) items in that file around flag processing and cue help lsp).
2. Code actions (refactors) exposed by the server
internal/lsp/server/codeaction.go ships three concrete refactors that users get via textDocument/codeAction. None are mentioned on the wiki:
- Add surrounding struct braces (
refactor.rewrite.convertToStruct) — wraps the selection in { ... }.
- Remove surrounding struct braces (
refactor.rewrite.convertFromStruct) — the inverse; marked IsPreferred so editors prioritise it when both apply.
- Organize Imports (
source.organizeImports).
A short subsection with a screenshot or gif and editor-specific keybinding hints (e.g. Ctrl+. in VSCode, <leader>ca in common Neovim setups) would go a long way.
The wiki at https://github.com/cue-lang/cue/wiki/LSP:-Getting-started is a good on-ramp, but there are two concrete gaps worth addressing:
1.
cue lspshould no longer be hiddencmd/cue/cmd/lsp.go:29still marks the subcommand asHidden: true. Given the feature set below is real and user-facing, it's probably time to unhide it (and flesh out theTODO(myitcv)items in that file around flag processing andcue help lsp).2. Code actions (refactors) exposed by the server
internal/lsp/server/codeaction.goships three concrete refactors that users get viatextDocument/codeAction. None are mentioned on the wiki:refactor.rewrite.convertToStruct) — wraps the selection in{ ... }.refactor.rewrite.convertFromStruct) — the inverse; markedIsPreferredso editors prioritise it when both apply.source.organizeImports).A short subsection with a screenshot or gif and editor-specific keybinding hints (e.g.
Ctrl+.in VSCode,<leader>cain common Neovim setups) would go a long way.