A language server for CEL (Common Expression Language).
It operates on individual .cel files, providing various LSP features.
$ go install github.com/stefanvanburen/cells/cmd/cells@latest- Semantic highlighting
- Diagnostics
- Formatting
- Hover
- References
- Completion
- Signature help
- Variable renaming
- Inlay hints (expression evaluation)
In addition to operating as a language server, cells provides CLI commands for use outside an editor.
Format CEL source files. With no arguments, reads from stdin and writes to stdout.
$ echo "1+2" | cells format
1 + 2
$ cells format file.cel
$ cells format --write file.cel
$ cells format --diff file.cel
$ cells format --diff --write file.celCheck CEL source files for parse and type errors.
Prints file:line:col: error: message for each diagnostic and exits 1 if any are found.
$ cells check file.cel
$ cells check *.celShow documentation for the element at a given position (file:line:col, 1-indexed).
$ cells hover file.cel:1:7List all references to the identifier at a given position.
Each reference is printed as file:line:col.
$ cells references file.cel:1:1Rename the identifier at a given position.
Without --write, prints the updated content to stdout.
$ cells rename --new-name=newVar file.cel:1:1
$ cells rename --new-name=newVar --write file.cel:1:1Add to your config (e.g. ~/.config/nvim/init.lua):
vim.lsp.config("cells", {
filetypes = { "cel" },
cmd = { "cells", "serve" },
})
vim.lsp.enable("cells")Neovim doesn't recognize .cel files by default
(until 0.12 is released),
so you'll also need to add a filetype detection rule:
vim.filetype.add({
extension = {
cel = "cel",
},
})To verify it's working, open a .cel file and run :checkhealth lsp or :LspInfo.