close
Skip to content

Integrations

VSCode

Zed

Install the Civet extension from the Zed extension marketplace, or install it as a dev extension from the lsp/zed/ directory of the Civet repo.

The extension requires civet-lsp to be on your PATH:

bash
npm install -g @danielx/civet-language-server

To enable semantic token highlighting (context-aware colors for variables, functions, types, etc.), add to your Zed settings:

json
{
  "languages": {
    "Civet": {
      "semantic_tokens": "combined"
    }
  }
}

"combined" overlays LSP semantic tokens on top of tree-sitter highlighting.

Neovim

Neovim 0.10+ supports LSP natively. Add this to your init.lua:

lua
vim.filetype.add({ extension = { civet = "civet" } })

vim.api.nvim_create_autocmd("FileType", {
  pattern = "civet",
  callback = function(args)
    vim.lsp.start({
      name = "civet_lsp",
      cmd = { "node", "/path/to/civet/lsp/server/dist/server.js", "--stdio" },
      root_dir = vim.fs.root(args.file, { "tsconfig.json", "package.json", ".git" }) or vim.fn.getcwd(),
    })
  end,
})

Replace /path/to/civet with your local Civet repo path, or the path to a globally installed @danielx/civet-language-server package.

Build the server first if using the repo directly:

bash
cd lsp/server && pnpm build

Tree-sitter (syntax highlighting)

The Civet tree-sitter grammar is included in the Civet repo at lsp/tree-sitter/. After cloning Civet, register it in your init.lua:

lua
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.civet = {
  install_info = {
    url = "https://github.com/DanielXMoore/Civet",
    files = { "src/parser.c" },
    location = "lsp/tree-sitter",
    generate_requires_npm = false,
    requires_generate_from_grammar = false,
  },
  filetype = "civet",
}

Then run :TSInstall civet.

Helix

Clone the Civet repo and edit your languages.toml config for helix

toml
[[grammar]]
name = "civet"
source = { path = "/path/to/civet/lsp/tree-sitter" }

[language-server.civet-lsp]
command = "civet-lsp"
args = ["--stdio"]

[[language]]
name = "civet"
scope = "source.civet"
file-types = ["civet"]
comment-token = "//"
language-servers = ["civet-lsp"]
grammar = "civet"

Tell helix to build the grammars.

shell
hx -g build

To get syntax highlighting, copy the highlights.scm file into your configuration.

shell
mkdir -p ~/.config/helix/runtime/queries/civet
cp /path/to/civet/lsp/tree-sitter/queries/highlights.scm ~/.config/helix/runtime/queries/civet/

Finally, verify your Civet setup for helix

shell
hx --health civet

Build tools

Starter Templates

Linters

Testing

Tooling

  • YavaScript is a standalone script runner supporting Civet (no Node required)