From dfcd079f82db1504c1d3304dcd0702fddaaf03bb Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Sat, 6 Apr 2024 19:16:12 +0530 Subject: lsp/c: set compilationDatabaseDirectory ccls relies on a JSON compilation database specified as compile_commands.json. npass need this after the switch to meson build to locate header files. for meson projects this assumes the name of the build directory is "/build". as of writing this, the project root directory is detected using the presence of ".git". https://git.sinanmohd.com/npass/commit/?id=4ff6158a6cd29e87222387870e6f01aca41b8183 --- lua/plugins/opts/lspconfig.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/plugins/opts/lspconfig.lua b/lua/plugins/opts/lspconfig.lua index 1a5842d..ecbf65a 100644 --- a/lua/plugins/opts/lspconfig.lua +++ b/lua/plugins/opts/lspconfig.lua @@ -24,6 +24,7 @@ lspconfig.lua_ls.setup(lsp_zero.nvim_lua_ls({ lspconfig.ccls.setup({ init_options = { + compilationDatabaseDirectory = "build", cache = { directory = vim.fn.stdpath("cache") .. "/ccls", }, -- cgit v1.2.3