Problem
When using other LSPs, such as csspell_ls, using switch_source_header always results in a printout of
Corresponding file cannot be determined.
This is due to that csspell_ls, as a LSP for spell checking, can't find the source or header file.
Possible solutions
Change
https://github.com/p00f/clangd_extensions.nvim/blob/b67cc417d9020fb4b83d46662351b4d16894905e/lua/clangd_extensions/utils.lua#L3-L8
to
function M.buf_request_method(method, params, handler, bufnr)
local clients = vim.lsp.get_clients({ bufnr = bufnr, method = method })
for _, client in pairs(clients) do
if client.name == "clangd" then
client:request(method, params, handler, bufnr)
return
end
end
end
Problem
When using other LSPs, such as
csspell_ls, usingswitch_source_headeralways results in a printout ofThis is due to that
csspell_ls, as a LSP for spell checking, can't find the source or header file.Possible solutions
Change
https://github.com/p00f/clangd_extensions.nvim/blob/b67cc417d9020fb4b83d46662351b4d16894905e/lua/clangd_extensions/utils.lua#L3-L8
to