ctags_ls
is a simple language server implementation to use ctags
in the editors that do not natively support it.
Note
This is not a full-featured language server and only supports basic functionalities such as goto definition, declaration, and implementation so far. It has been tested with Helix Editor and Zed Editor for C++ projects only.
ctags_ls
relies on readtags
to read the tags file, so Universal Ctags is required.
You need to generate tags file for your project before using the ctags_ls
. By default, the tags file should be named tags
and placed in the root of the workspace. However, you can specify your tags files from the initialization_options
configuration.
To configure ctags_ls
with Helix for C++, add the following to your languages.toml
:
[language-server.ctags_ls]
command = "path/to/ctags_ls"
config = { tags = ["tags", ".tags", "other tags file name"] }
[[language]]
name = "cpp"
language-servers = ["ctags_ls"]
To configure ctags_ls
with Zed for C++, add the following to your settings.json
to hijack the clangd configuration:
{
"lsp": {
"clangd": {
"binary": {
"path": "path/to/ctags_ls",
"arguments": []
},
"initialization_options": {
"tags": [
"tags",
".tags",
"other tags file name"
]
}
}
}
}