如何使用内置的 nvim lsp 触发 clnagd.switchSourceHeader

How to triger clnagd.switchSourceHeader using built-in nvim lsp

我曾经用 Coc.nvim

:CocCommand clangd.switchSourceHeader

但现在我已经转移到内置的 nvim lsp 并且不知道如何相同。

我为 coc 找到了这个解决方案,但仍然不知道如何为 nvim lsp 做这个。

execute 'edit' CocRequest('clangd', 'textDocument/switchSourceHeader', {'uri': 'file://'.expand("%:p")})

使用built-in LSP客户端时,推荐使用nvim-lspconfig plugin for configuring the servers. For clangd, it creates a command :ClangdSwitchSourceHeader (see documentation).