lazy clangd

This commit is contained in:
dlond 2025-05-30 19:29:31 +12:00
parent 9550090c6a
commit 22b264311a
1 changed files with 4 additions and 4 deletions

View File

@ -144,14 +144,14 @@ return {
pattern = '*',
callback = function(args)
local ft = vim.bo[args.buf].filetype
if vim.tbl_contains(M.clang_filetypes, ft) then
print('[clangd] BufReadPost fired for ft=' .. ft)
local dir = find_compile_commands()
if vim.tbl_contains(require('custom.plugins.lsp.clangd').clang_filetypes, ft) then
local M = require 'custom.plugins.lsp.clangd'
local dir = M.find_compile_commands()
M.start_clangd(dir)
vim.keymap.set('n', '<leader>lc', M.pick_commands_dir, { desc = '[L]ocate [c]ompile_commands.json for clangd' })
vim.api.nvim_clear_autocmds { group = 'clangd-once' }
end
end,
})
vim.keymap.set('n', '<leader>lc', M.pick_commands_dir, { desc = '[L]ocate [c]ompile_commands.json for clangd' })
end,
}