From 75f6ecf3cfac099995372b2f73fa7c5334f743f3 Mon Sep 17 00:00:00 2001 From: dlond Date: Fri, 30 May 2025 07:49:12 +1200 Subject: [PATCH] cleanup --- lua/custom/plugins/lsp/clangd.lua | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lua/custom/plugins/lsp/clangd.lua b/lua/custom/plugins/lsp/clangd.lua index a38c24e7..8d188fac 100644 --- a/lua/custom/plugins/lsp/clangd.lua +++ b/lua/custom/plugins/lsp/clangd.lua @@ -87,12 +87,8 @@ function M.watch_compile_commands(dir) return end - vim.notify('[clangd] Watcher triggered: ' .. fname) - if fname:match '[/\\]compile_commands%.json$' then - vim.notify '[clangd] MATCHED compile_commands.json' - end - if fname and fname:match '[/\\]compile_commands%.json$' and status.change then + vim.notify('[clangd] Watcher triggered: ' .. fname) if debounce_timer then debounce_timer:stop() debounce_timer:close() @@ -123,8 +119,15 @@ function M.pick_commands_dir() local entry = require('telescope.actions.state').get_selected_entry() require('telescope.actions').close(prompt_bufnr) vim.defer_fn(function() - if entry and type(entry[1]) == 'string' then - M.start_clangd(entry[1]) + if entry then + if type(entry[1]) == 'string' then + vim.notify('[clangd] pick_commands_dir: ' .. entry[1]) + M.start_clangd(entry[1]) + else + vim.notify('[clangd] pick_commands_dir: ' .. entry[1]) + end + else + vim.notify '[clangd] pick_commands_dir is nil' end end, 100) end)