caio.co/de/config.nvim

lsp: setup ccls

Id
8e7ab4e6fa2ec891ab3fcff366a19a0d091796fc
Author
Caio
Commit time
2023-06-29T17:30:09+02:00

Modified lua/config/lsp.lua

@@ -82,3 +82,24
},
},
})
+
+local function home_cache_dir(tail)
+ local base = vim.env.XDG_CACHE_HOME
+ if not base and vim.env.HOME then
+ base = vim.env.HOME .. "/.cache"
+ end
+ -- fallback to a hidden dir on cwd
+ if not base then
+ return '.' .. tail
+ end
+
+ return base .. '/' .. tail
+end
+
+config.ccls.setup({
+ init_options = {
+ cache = {
+ directory = home_cache_dir('ccls'),
+ },
+ },
+})