aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim_lsp/clangd.lua
diff options
context:
space:
mode:
authorEisuke Kawashima <e-kwsm@users.noreply.github.com>2020-01-28 14:58:44 +0900
committerJustin M. Keyes <justinkz@gmail.com>2020-01-27 21:58:44 -0800
commit638dad178311ee890b54587280790955eefd75ad (patch)
treeefc148b1c382cfbb7d4de58d82058b3518da30c1 /lua/nvim_lsp/clangd.lua
parentUpdate coursier url (#104) (diff)
downloadnvim-lspconfig-638dad178311ee890b54587280790955eefd75ad.tar
nvim-lspconfig-638dad178311ee890b54587280790955eefd75ad.tar.gz
nvim-lspconfig-638dad178311ee890b54587280790955eefd75ad.tar.bz2
nvim-lspconfig-638dad178311ee890b54587280790955eefd75ad.tar.lz
nvim-lspconfig-638dad178311ee890b54587280790955eefd75ad.tar.xz
nvim-lspconfig-638dad178311ee890b54587280790955eefd75ad.tar.zst
nvim-lspconfig-638dad178311ee890b54587280790955eefd75ad.zip
clangd: fallback root_dir to CWD #105
c.f. #44
Diffstat (limited to 'lua/nvim_lsp/clangd.lua')
-rw-r--r--lua/nvim_lsp/clangd.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/lua/nvim_lsp/clangd.lua b/lua/nvim_lsp/clangd.lua
index c2a4d42b..57cdbd7f 100644
--- a/lua/nvim_lsp/clangd.lua
+++ b/lua/nvim_lsp/clangd.lua
@@ -6,7 +6,7 @@ skeleton.clangd = {
default_config = util.utf8_config {
cmd = {"clangd", "--background-index"};
filetypes = {"c", "cpp", "objc", "objcpp"};
- root_dir = util.root_pattern("compile_commands.json", "compile_flags.txt", ".git");
+ root_dir = util.root_pattern("compile_commands.json", "compile_flags.txt", ".git", ".");
log_level = lsp.protocol.MessageType.Warning;
settings = {};
};
@@ -23,7 +23,7 @@ clangd relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONC
as compile_commands.json or, for simpler projects, a compile_flags.txt.
]];
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 cwd]];
on_init = [[function to handle changing offsetEncoding]];
capabilities = [[default capabilities, with offsetEncoding utf-8]];
};