⚠️ This guide is a WIP.
You can use either ccls
or clangd
. You don't need both.
See ccls.md or clangd.md for ccls
or clangd
, respectively.
⚠️ This guide is a WIP.
You can use either ccls
or clangd
. You don't need both.
See ccls.md or clangd.md for ccls
or clangd
, respectively.
NOTE: This guide is a WIP.
sudo apt install ccls
sudo apt install clang libclang-dev
sudo apt install llvm-dev rapidjson-dev
sudo apt install cmake
# ninja (maybe optional)
See https://github.com/MaskRay/ccls/wiki/coc.nvim.
In Vim, type :CocConfig
and:
{
"languageserver": {
"ccls": {
"command": "ccls",
"filetypes": ["c", "cpp", "cuda", "objc", "objcpp"],
"rootPatterns": [".ccls-root", "compile_commands.json"],
"initializationOptions": {
"cache": {
"directory": ".ccls-cache"
},
"client": {
"snippetSupport": true
}
}
}
}
}
Full indexing:
ccls --index=.
NOTE: This guide is a WIP.
See https://github.com/clangd/clangd/releases/tag/13.0.0.
Full indexing (?):
clangd-indexer --executor=all-TUs compile_commands.json
NOTE: This guide is a WIP.
See https://github.com/neoclide/coc.nvim.
Install node:
export PREFIX="/home/user"
curl -sL install-node.vercel.app/lts | bash
.vimrc
:
" vim-plug
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Jus copy the example in coc.nvim.
Additionally you can add set tagfunc=CocTagFunc
in .vimrc
.
In Vim:
:CocInstall coc-pyright
:CocInstall coc-clangd
In Vim, type :CocConfig
and:
{
"clangd.arguments": ["-j=10"]
}
-j
: number of workersNOTE: This guide is a WIP.
It is the same for both ccls or clangd. See https://github.com/MaskRay/ccls/wiki/Project-Setup or https://clangd.llvm.org/installation.html#project-setup.
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=YES -S . -BDebug -DCMAKE_BUILD_TYPE=Debug # ...
# you can use either "-G 'Unix Makefiles'" or "-G Ninja" ------------------------^
# cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=YES
ln -s Debug/compile_commands.json .
make defconfig
make
./scripts/clang-tools/gen_compile_commands.py