From 5d7b298adc164cf022f458a3bc189791f768a4d9 Mon Sep 17 00:00:00 2001 From: dlond Date: Fri, 30 May 2025 01:12:36 +1200 Subject: [PATCH] changed deprecated cmd --- lua/custom/plugins/lsp/clangd.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/custom/plugins/lsp/clangd.lua b/lua/custom/plugins/lsp/clangd.lua index 54243420..cc4ea828 100644 --- a/lua/custom/plugins/lsp/clangd.lua +++ b/lua/custom/plugins/lsp/clangd.lua @@ -39,9 +39,9 @@ function M.setup_clangd(commands_dir) } for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do - local ft = vim.api.nvim_buf_get_option(bufnr, 'filetype') + local ft = vim.api.nvim_get_option_value('filetype', { buf = bufnr }) if vim.tbl_contains(M.clang_filetypes, ft) then - vim.lsp.buf_attach_client(bufnr, vim.lsp.get_active_clients({ name = 'clangd' })[1].id) + vim.lsp.buf_attach_client(bufnr, vim.lsp.get_clients({ name = 'clangd' })[1].id) end end end @@ -62,6 +62,7 @@ function M.pick_commands_dir() require('telescope.actions').close(prompt_bufnr) if commands_dir ~= '' then M.setup_clangd(commands_dir) + end end) return true end,