Skip to content

inlay_hint: "Failed to delete autocmd" error when closing a buffer #24456

@MariaSolOs

Description

@MariaSolOs

Problem

With the latest nightly release, I'm seeing the following error every time I close a buffer:

image

So far I've seen this happen with Lua and Rust files.

Note that this doesn't happen with NVIM v0.10.0-dev-692+g86ce3878d.

Steps to reproduce

The only inlay-hint related setup I have is this pair of autocommands that toggles inlay hints:

    if buf_client.supports_method 'textDocument/inlayHint' then
        local inlay_hints_group = vim.api.nvim_create_augroup('ToggleInlayHints', { clear = false })

        -- Initial inlay hint display.
        local mode = vim.api.nvim_get_mode().mode
        vim.lsp.inlay_hint(bufnr, mode == 'n' or mode == 'v')

        vim.api.nvim_create_autocmd('InsertEnter', {
            group = inlay_hints_group,
            buffer = bufnr,
            callback = function()
                vim.lsp.inlay_hint(bufnr, false)
            end,
        })
        vim.api.nvim_create_autocmd('InsertLeave', {
            group = inlay_hints_group,
            buffer = bufnr,
            callback = function()
                vim.lsp.inlay_hint(bufnr, true)
            end,
        })
    end

The rest of my LSP configuration is here.

Expected behavior

For there to be no error.

Neovim version (nvim -v)

NVIM v0.10.0-dev-709+gce56ad2ba

Vim (not Nvim) behaves the same?

No

Operating system/version

Mac Ventura 13.4.1

Terminal name/version

kitty 0.28.1

$TERM environment variable

xterm-kitty

Installation

bob

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions