diff --git a/lua/custom/plugins/lsp/clangd.lua b/lua/custom/plugins/lsp/clangd.lua index 3b7388ef..05acdc68 100644 --- a/lua/custom/plugins/lsp/clangd.lua +++ b/lua/custom/plugins/lsp/clangd.lua @@ -71,9 +71,8 @@ function M.pick_commands_dir() map('i', '', function(prompt_bufnr) local entry = require('telescope.actions.state').get_selected_entry() require('telescope.actions').close(prompt_bufnr) - M.stop_clangd() vim.defer_fn(function() - M.start_clangd(entry[1]) + M.reload_clangd(entry[1]) end, 100) end) return true @@ -122,7 +121,7 @@ function M.watch_compile_commands(dir) vim.schedule(function() vim.notify '[clangd] Detected compile_commands.json change. Reloading ...' watch_path = vim.fn.fnamemodify(fname, ':h') - M.start_clangd(watch_path) + M.reload_clangd(watch_path) M.watch_compile_commands(watch_path) end) end)