add ccls support

neovim_0_5
ray-x 3 years ago
parent 4a58870a28
commit 69565e38d3

@ -91,6 +91,8 @@ navigator will bind keys and handler for you. The lsp will be loaded lazily base
The plugin can be loaded lazily (packer `opt = true` ), And it will check if optional plugins existance and load those plugins only if they existed. The plugin can be loaded lazily (packer `opt = true` ), And it will check if optional plugins existance and load those plugins only if they existed.
The termianl will need to be able to output nerdfont and emoji correctly. I am using Kitty with nerdfont (Victor Mono).
## Usage ## Usage
Please refer to lua/navigator/lspclient/mapping.lua on key mappings. Should be able to work out-of-box. Please refer to lua/navigator/lspclient/mapping.lua on key mappings. Should be able to work out-of-box.

@ -66,7 +66,6 @@ local golang_setup = {
} }
}, },
root_dir = function(fname) root_dir = function(fname)
local util = require("lspconfig").util
return util.root_pattern("go.mod", ".git")(fname) or util.path.dirname(fname) return util.root_pattern("go.mod", ".git")(fname) or util.path.dirname(fname)
end end
} }
@ -171,6 +170,19 @@ local pyright_cfg = {
} }
} }
local ccls_cfg = {
init_options = {
compilationDatabaseDirectory = "build",
root_dir = [[ util.root_pattern("compile_commands.json", "compile_flags.txt", "CMakeLists.txt", "Makefile", ".git") or util.path.dirname ]],
index = {
threads = 2
},
clang = {
excludeArgs = {"-frounding-math"}
}
}
}
local servers = { local servers = {
"gopls", "gopls",
"tsserver", "tsserver",
@ -188,6 +200,7 @@ local servers = {
"cssls", "cssls",
"yamlls", "yamlls",
"clangd", "clangd",
"ccls",
"sqls", "sqls",
"denols", "denols",
"dartls", "dartls",
@ -272,5 +285,6 @@ local function setup(user_opts)
load_cfg(ft, "clangd", clang_cfg, loaded) load_cfg(ft, "clangd", clang_cfg, loaded)
load_cfg(ft, "rust_analyzer", rust_cfg, loaded) load_cfg(ft, "rust_analyzer", rust_cfg, loaded)
load_cfg(ft, "pyright", pyright_cfg, loaded) load_cfg(ft, "pyright", pyright_cfg, loaded)
load_cfg(ft, "ccls", ccls_cfg, loaded)
end end
return {setup = setup, cap = cap} return {setup = setup, cap = cap}

Loading…
Cancel
Save