p00f / clangd_extensions.nvim

Clangd's off-spec features for neovim's LSP client. Use https://sr.ht/~p00f/clangd_extensions.nvim instead
MIT License
448 stars 16 forks source link

nvim 0.10 inlay hints broken #37

Closed barrett-ruth closed 1 year ago

barrett-ruth commented 1 year ago

I see in a recent commit you added support for nvim 0.10 inlay hints.

On the event LspAttach with clangd, the field client.server_capabilities.inlayHintProvider is not set to true. However, clangdInlayHintsProvider is - I think clangd may be calling the inlay hint field something other than what the standard expects? Either way, the error stems from when a lsp request is sent in this line and the provider is not found in the LSP config.

I get the following error when opening up an empty c++ file in nvim 0.10:

image

Let me know if I can provide more info or if you think my environment is set up incorrectly.

barrett-ruth commented 1 year ago

Also, as expected, changing the "textDocument/inlayHint" back to "clangd/inlayHints" works like a charm in the vim.lsp.buf_request, so the inlay hints you/the rust-tools.nvim author wrote work correctly:

image
p00f commented 1 year ago

You need to update clangd. Before it was in the protocol, clangd used to have its own request (clangd/inlayHints). Or just use this plugin, which uses clangd's off spec inlay hints.

p00f commented 1 year ago

In any case this is the wrong place if you're using LSP inlay hints - this plugin is only for off-spec features

To reiterate, either - 1) Update clangd, use 0.10's LSP inlay hints and disable inlay hints in clangd_extensions.nvim 2) Use clangd_extensions.nvim and don't enable 0.10's LSP inlay hints

barrett-ruth commented 1 year ago

Thank you for explaining the issue clearly. Apologies for my misconceptions.