aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
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]];
};
};
}