simplified clangd setup
This commit is contained in:
parent
75add61c7f
commit
de83e49f90
|
@ -118,6 +118,11 @@ return {
|
|||
'neovim/nvim-lspconfig',
|
||||
ft = M.clang_filetypes,
|
||||
config = function()
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = M.clang_filetypes,
|
||||
group = vim.api.nvim_create_autocmd('clangd-setup', { clear = true }),
|
||||
callback = function()
|
||||
if not vim.lsp.get_clients({ name = 'clangd' })[1] then
|
||||
local dir = find_compile_commands()
|
||||
if dir then
|
||||
vim.notify('[clangd] Starting with compile_commands from: ' .. dir)
|
||||
|
@ -126,6 +131,9 @@ return {
|
|||
vim.notify '[clangd] No compile_commands found. Using fallback config.\nUse <leader>cc to manually set location.'
|
||||
M.start_clangd(nil)
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.keymap.set('n', '<leader>cc', M.pick_commands_dir, { desc = 'Pick location of compile_commands.json for clangd' })
|
||||
end,
|
||||
|
|
Loading…
Reference in New Issue