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.

Build tools

Starter Templates

Linters

Testing

Tooling

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