This commit is contained in:
dlond 2025-05-30 06:40:31 +12:00
parent 77e6925664
commit 1fe7467055
1 changed files with 2 additions and 5 deletions

View File

@ -37,9 +37,6 @@ function M.start_clangd(dir)
if dir and dir ~= '' then if dir and dir ~= '' then
vim.notify('[clangd] Setting up with: ' .. dir) vim.notify('[clangd] Setting up with: ' .. dir)
table.insert(cmd, '--compile-commands-dir=' .. dir) table.insert(cmd, '--compile-commands-dir=' .. dir)
else
vim.notify '[clangd] No compile_commands.json found.\nUse <leader>cc to manually set location'
table.insert(cmd, '--compile-commands-dir=.')
end end
lspconfig.clangd.setup { lspconfig.clangd.setup {
@ -71,8 +68,8 @@ function M.watch_compile_commands(dir)
local watch_path = dir or vim.fn.getcwd() local watch_path = dir or vim.fn.getcwd()
local watch_file = watch_path .. '/compile_commands.json' local watch_file = watch_path .. '/compile_commands.json'
if not M.auto_watch_enabled or not vim.fn.filereadable(watch_file) then if not vim.fn.filereadable(watch_file) then
return vim.notify '[clangd] No compile_commands.json found.\nUse <leader>cc to manually set location when available.'
end end
watcher = uv.new_fs_event() watcher = uv.new_fs_event()