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:
npm install -g @danielx/civet-language-serverTo enable semantic token highlighting (context-aware colors for variables, functions, types, etc.), add to your Zed settings:
{
"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:
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:
cd lsp/server && pnpm buildTree-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:
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
- unplugin integrates Civet into Vite, esbuild, Astro, Farm, Rolldown, Rollup, and Webpack, including
.d.tsgeneration (see basic instructions) - ESM/CJS loader for
import/requireto support.civetfiles - Babel plugin
- Including React Native / Metro
- Jest plugin
- Gulp plugin
- Bun plugin
- Meteor plugin
<script>tag- Civetman automatically compiles
.civetfiles, making it easy to integrate with arbitrary build chains (see also vite-plugin-civetman)
Starter Templates
Linters
Testing
- c8 + Mocha
- Civet CLI
- Civet Discord Bot transpiles
```civet ... ```code in your Discord server
Tooling
- YavaScript is a standalone script runner supporting Civet (no Node required)
