From 1f53e61d68fd23a37642ea65312420f745c8010b Mon Sep 17 00:00:00 2001 From: dlond Date: Fri, 30 May 2025 06:53:56 +1200 Subject: [PATCH] cleanup --- lua/custom/plugins/lsp/clangd.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/custom/plugins/lsp/clangd.lua b/lua/custom/plugins/lsp/clangd.lua index 42f77724..b4bd9db3 100644 --- a/lua/custom/plugins/lsp/clangd.lua +++ b/lua/custom/plugins/lsp/clangd.lua @@ -37,6 +37,9 @@ function M.start_clangd(dir) if dir and dir ~= '' then vim.notify('[clangd] Setting up with: ' .. dir) table.insert(cmd, '--compile-commands-dir=' .. dir) + M.watch_compile_commands(dir) + else + vim.notify('[clangd] Empty or nil dir: ' .. dir) end lspconfig.clangd.setup { @@ -126,8 +129,7 @@ return { config = function() local dir = find_compile_commands() M.start_clangd(dir) - M.watch_compile_commands(dir) - vim.keymap.set('n', 'cc', M.pick_commands_dir, { desc = 'Pick location of compile_commands.json for clangd' }) + vim.keymap.set('n', 'lc', M.pick_commands_dir, { desc = '[L]ocate [c]ompile_commands.json for clangd' }) end, }