Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

stefanvanburen/cells

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

40 Commits

Repository files navigation

cells

A language server for CEL (Common Expression Language). It operates on individual .cel files, providing various LSP features.

Installation

$ go install github.com/stefanvanburen/cells/cmd/cells@latest

Features

  • Semantic highlighting
  • Diagnostics
  • Formatting
  • Hover
  • References
  • Completion
  • Signature help
  • Variable renaming
  • Inlay hints (expression evaluation)

CLI

In addition to operating as a language server, cells provides CLI commands for use outside an editor.

cells format

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.cel

cells check

Check 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 *.cel

cells hover

Show documentation for the element at a given position (file:line:col, 1-indexed).

$ cells hover file.cel:1:7

cells references

List all references to the identifier at a given position. Each reference is printed as file:line:col.

$ cells references file.cel:1:1

cells rename

Rename 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:1

Usage

Neovim

Add to your config (e.g. ~/.config/nvim/init.lua):

vim.lsp.config("cells", {
 filetypes = { "cel" },
 cmd = { "cells", "serve" },
})
vim.lsp.enable("cells")

Neovim recognizes .cel files by default as of 0.12.

To verify it's working, open a .cel file and run :checkhealth lsp or :LspInfo.

About

A Language Server for CEL

Topics

Resources

Stars

Watchers

Forks

Contributors

AltStyle によって変換されたページ (->オリジナル) /