cleanup
This commit is contained in:
parent
1fe7467055
commit
1f53e61d68
|
@ -37,6 +37,9 @@ 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)
|
||||||
|
M.watch_compile_commands(dir)
|
||||||
|
else
|
||||||
|
vim.notify('[clangd] Empty or nil dir: ' .. dir)
|
||||||
end
|
end
|
||||||
|
|
||||||
lspconfig.clangd.setup {
|
lspconfig.clangd.setup {
|
||||||
|
@ -126,8 +129,7 @@ return {
|
||||||
config = function()
|
config = function()
|
||||||
local dir = find_compile_commands()
|
local dir = find_compile_commands()
|
||||||
M.start_clangd(dir)
|
M.start_clangd(dir)
|
||||||
M.watch_compile_commands(dir)
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>cc', M.pick_commands_dir, { desc = 'Pick location of compile_commands.json for clangd' })
|
vim.keymap.set('n', '<leader>lc', M.pick_commands_dir, { desc = '[L]ocate [c]ompile_commands.json for clangd' })
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue