~p00f/public-inbox

3 2

Breaking change: redo config

Details
Message ID
<ypi9a5v2vyzo.fsf@gmail.com>
DKIM signature
missing
Download raw message
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

Re: Breaking change in clangd_extensions.nvim: redo config

Details
Message ID
<ypi97cq6vyth.fsf@gmail.com>
In-Reply-To
<ypi9a5v2vyzo.fsf@gmail.com> (view parent)
DKIM signature
missing
Download raw message
Sorry I forgot to mention, this is about clangd_extensions.nvim
Details
Message ID
<CALhxUeovFu3Dv-+OW7YWHquDDAtHrfp72LioVn1Y1Lp5AZWL8A@mail.gmail.com>
In-Reply-To
<ypi9a5v2vyzo.fsf@gmail.com> (view parent)
DKIM signature
missing
Download raw message
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
Details
Message ID
<ypi9bkf98tm2.fsf@gmail.com>
In-Reply-To
<CALhxUeovFu3Dv-+OW7YWHquDDAtHrfp72LioVn1Y1Lp5AZWL8A@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
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
Reply to thread Export thread (mbox)