aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorPeter Lithammer <peter.lithammer@gmail.com>2021-04-14 11:03:31 +0200
committerGitHub <noreply@github.com>2021-04-14 11:03:31 +0200
commit71de85e633cf47705d9a89208198ef05d9d41395 (patch)
treee0752600782cdbd32a595b6f201663eb50a6b250 /lua
parent[docgen] Update CONFIG.md (diff)
parentUse the file path as root_dir when ccls does not find root_dir (diff)
downloadnvim-lspconfig-71de85e633cf47705d9a89208198ef05d9d41395.tar
nvim-lspconfig-71de85e633cf47705d9a89208198ef05d9d41395.tar.gz
nvim-lspconfig-71de85e633cf47705d9a89208198ef05d9d41395.tar.bz2
nvim-lspconfig-71de85e633cf47705d9a89208198ef05d9d41395.tar.lz
nvim-lspconfig-71de85e633cf47705d9a89208198ef05d9d41395.tar.xz
nvim-lspconfig-71de85e633cf47705d9a89208198ef05d9d41395.tar.zst
nvim-lspconfig-71de85e633cf47705d9a89208198ef05d9d41395.zip
Merge pull request #841 from Adnios/master
Diffstat (limited to 'lua')
-rw-r--r--lua/lspconfig/ccls.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/lua/lspconfig/ccls.lua b/lua/lspconfig/ccls.lua
index 190ffffc..fd4a4326 100644
--- a/lua/lspconfig/ccls.lua
+++ b/lua/lspconfig/ccls.lua
@@ -5,7 +5,9 @@ configs.ccls = {
default_config = {
cmd = {"ccls"};
filetypes = {"c", "cpp", "objc", "objcpp"};
- root_dir = util.root_pattern("compile_commands.json", "compile_flags.txt", ".git");
+ root_dir = function(fname)
+ return util.root_pattern("compile_commands.json", "compile_flags.txt", ".git")(fname) or util.path.dirname(fname)
+ end;
};
docs = {
description = [[
@@ -35,7 +37,7 @@ lspconfig.ccls.setup {
]];
default_config = {
- root_dir = [[root_pattern("compile_commands.json", "compile_flags.txt", ".git")]];
+ root_dir = [[root_pattern("compile_commands.json", "compile_flags.txt", ".git") or dirname]];
};
};
}