RRethy / vim-illuminate

illuminate.vim - (Neo)Vim plugin for automatically highlighting other uses of the word under the cursor using either LSP, Tree-sitter, or regex matching.
2.12k stars 44 forks source link

shows not an editor command `IlluminationDisable!` #117

Closed arionrefat closed 1 year ago

arionrefat commented 1 year ago

Describe the bug Not an editor command IlluminationDisable!

This is my minimal init

local function lsp_highlight_document(client)
    -- Set autocommands conditional on server_capabilities
    local status_ok, illuminate = pcall(require, "illuminate")
    if not status_ok then
        return
    end
    illuminate.on_attach(client)
    -- end
end

M.on_attach = function(client, bufnr)
    if client.name == "tsserver" then
        client.resolved_capabilities.document_formatting = false
    elseif client.name == "sumneko_lua" then
        client.resolved_capabilities.document_formatting = false
    elseif client.name == "gopls" then
        client.resolved_capabilities.document_formatting = false
    end
    lsp_keymaps(bufnr)
    lsp_highlight_document(client)
end

Expected behavior It should not display this error

Screenshots image

fdelacruz commented 1 year ago

I was just about to report this also.

RRethy commented 1 year ago

v2 for the plugin has been released, see here. You don't need on_attach anymore in your config, and these are the provided commands IlluminatePause, IlluminateResume, IlluminateToggle, IlluminatePauseBuf, IlluminateResumeBuf, IlluminateToggleBuf.

The issue you posted was an oversight, if you want to ignore the v2 and continue using on_attach things will work as they did before with the fix I pushed.

fdelacruz commented 1 year ago

Thanks!