A Language Server Protocol (LSP) implementation using universal-ctags as backend, supporting 100+ languages.
This won't replace your dedicated language server, and it doesn't try to. The goal is to have a "better than nothing" language server that's trivial to setup for any language.
On startup, ctags-lsp runs universal-ctags to index your workspace and keeps that index in memory to provide code completion, go-to-definition, and document/workspace symbols.
It never creates or updates tagfiles.
brew will automatically install dependencies for you.
# install with brew
brew install ctags-lspWhen installing with mise or go, you must install universal-ctags yourself (ctags installation).
# install with mise
mise use -g github:netmute/ctags-lsp# install with go
go install github.com/netmute/ctags-lsp@latestAny editor with a built-in LSP client should work. Working examples are below.
vim.lsp.config("ctags_lsp", {
cmd = { "ctags-lsp" },
filetypes = { "ruby" }, -- Change this to the language(s) nvim should attach the LSP to
})
vim.lsp.enable("ctags_lsp")Add this to ~/.config/helix/languages.toml:
[language-server.ctags-lsp]
command = "ctags-lsp"
[[language]]
name = "toml" # Change this to the language helix should attach the LSP to
language-servers = [ "ctags-lsp" ]Most projects are completely indexed in less than 1s. If startup is slow for your workspace:
- Limit which languages are being indexed with
--languages. The option is passed through to ctags unchanged; for available options see the universal-ctags manual on the topic. - Leverage an existing tagfile, so
ctags-lspdoesn’t have to runctagson startup, with--tagfile.
You can use an existing tagfile with --tagfile=<path>. When set, the server parses the tagfile and skips the workspace scan. This is only intended as a fallback option to possibly improve performance, and should not be used otherwise.
ctags-lsp will never write or update tagfiles.
For obvious reasons, --languages has no effect when using a tagfile.
> ctags-lsp --help
CTags Language Server
Provides LSP functionality based on ctags.
Usage:
ctags-lsp [options]
Options:
--help Show this help message
--version Show version information
--ctags-bin <name> Use custom ctags binary name (default: "ctags")
--tagfile <path> Use tagfile instead of scanning
--languages <value> Pass through language filter list to ctags