A Language Server Protocol implementation for the CUE language.
🚨 🏗️ This project is a work in progress and may not be completely functional yet 🏗️ 🚨
- Full cuelang file formatting in your IDE
go get -u github.com/bobmaertz/cuelang-lsp
Describe how to use your CUE LSP, including any command-line options or integration with popular editors.
lsp [options]
The lsp currently supports a single filepath argument for a debug log.
lsp ~/out.log
- Go 1.22 or higher
- CUE 0.10.0 or higher
git clone https://github.com/bobmaertz/cuelang-lsp.git
cd cuelang-lsp
make build
make test
There are two commands in the /cmd directory, one for the language server and the other for formatting. The LSP binay can be run using the binary located at /bin/lsp
To test the formatting functionality, use the following command.
go run fmtr <path/to/cuefile>.cue
I've setup my local environment to use this LSP for *.cue files.
local client = vim.lsp.start_client {
name = "cuelang-lsp",
cmd = { "/Users/bob/personal/cuelang-lsp/lsp" }
}
if not client then
vim.notify "cuelang-lsp did not start"
return
end
vim.api.nvim_create_autocmd("FileType", {
pattern = "cue",
callback = function()
vim.lsp.buf_attach_client(0, client)
end
})
Only necessary if there the pattern used in the lsp configuration is not based on the standard treesitter filetype for cue.
:setfiletype cue
:LspRestart
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.jjk