I redid the configuration, now one doesn't need to call `setup()` at all
if they are happy with the defaults.
Server options are to be configured normally via
`vim.lsp.start`/nvim-lspconfig
To enable inlay hints like earlier, add the following lines to
lspconfig/`vim.lsp.start`'s `on_attach`:
require("clangd_extensions.inlay_hints").setup_autocmd()
require("clangd_extensions.inlay_hints").set_inlay_hints()
Sorry for the breaking change but this simplifies everything a lot
While tinkering with my local setup, I noticed that on neovim nightly
it's sufficient to enable native inlay_hint functionality in LspAttach
autocmd.
Here's relevant part from my config:
vim.api.nvim_create_augroup('LspWatchers', { clear = true })
vim.api.nvim_create_autocmd('LspAttach', {
group = 'LspWatchers',
callback = function(args)
if not (args.data and args.data.client_id) then
return
end
local bufnr = args.buf
local client = vim.lsp.get_client_by_id(args.data.client_id)
-- ...
-- Enable inlay hints
if client.server_capabilities.inlayHintProvider then
vim.lsp.inlay_hint(bufnr, true)
end
-- ...
end,
desc = 'Set up buffer local mappings, lens etc on LSP attach',
})
Things truly got simpler, thank you!
On Tue, Aug 8, 2023 at 8:18 AM Chinmay Dalal
<dalal.chinmay.0101@gmail.com> wrote:
>
>
> I redid the configuration, now one doesn't need to call `setup()` at all
> if they are happy with the defaults.
>
> Server options are to be configured normally via
> `vim.lsp.start`/nvim-lspconfig
>
> To enable inlay hints like earlier, add the following lines to
> lspconfig/`vim.lsp.start`'s `on_attach`:
>
> require("clangd_extensions.inlay_hints").setup_autocmd()
> require("clangd_extensions.inlay_hints").set_inlay_hints()
>
> Sorry for the breaking change but this simplifies everything a lot
Dmytro Soltys <soap@slotos.net> writes:
> While tinkering with my local setup, I noticed that on neovim nightly
> it's sufficient to enable native inlay_hint functionality in LspAttach
> autocmd.
Yep, I'll remove inlay hints some time after neovim 0.10 lands