akinsho / flutter-tools.nvim

Tools to help create flutter apps in neovim using the native lsp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] lsp code actions not loading in nvim 0.10

eEQK opened this issue · comments

commented

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

after I install neovim 0.10 code actions do not work anymore (textDocument/codeAction capability check in LSP client returns false, as in not supported)

Expected Behavior

code actions should work

Steps To Reproduce

  1. get a working setup on neovim 0.9
  2. install neovim 0.10

Environment

- OS: arch 6.6.26-1-lts
- Flutter version:Flutter 3.19.5
- Is flutter in $PATH: yes
- neovim version: NVIM v0.10.0-dev-2942+g96d0c709b6

Anything else?

the workaround I found:

require("flutter-tools").setup {
    -- ...
    lsp = {
        -- ...
        capabilities = function(config)
            config.textDocument.codeAction = {
                dynamicRegistration = false,
                codeActionLiteralSupport = {
                    codeActionKind = {
                        valueSet = {
                            "",
                            "quickfix",
                            "refactor",
                            "refactor.extract",
                            "refactor.inline",
                            "refactor.rewrite",
                            "source",
                            "source.organizeImports",
                        },
                    },
                },
            }

            return config
        end,
    }
}

credits: https://gist.github.com/PatOConnor43/88156409b03794f5e05280dbfb42faa6