flutter-tools.nvim icon indicating copy to clipboard operation
flutter-tools.nvim copied to clipboard

[BUG] textDocument/formatting not supported on_attach

Open preiter93 opened this issue 1 year ago • 4 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

The call to client.supports_method("textDocument/formatting") returns false when called on_attach.

This was not the case a few days ago. Unfortunately, I don't know if it was introduced by the Neovim upgrade to v0.10 or by an upgrade of the Flutter tools (I suspect the former)

Maybe it is related to https://github.com/akinsho/flutter-tools.nvim/issues/346

Expected Behavior

The call to client.supports_method("textDocument/formatting") returns true when called on_attach

Steps To Reproduce

  1. Instal nvim 0.10
  2. Use this config
return {
    'akinsho/flutter-tools.nvim',
    dependencies = { 'mason-lspconfig.nvim', 'nvim-lua/plenary.nvim', 'stevearc/dressing.nvim' },
    opts = {
        lsp = {
            on_attach = function(client, bufnr)
                assert(client.supports_method("textDocument/formatting"), "flutter client must support formatting")
            end,
        }
    }
}
  1. Notice that it throws an assertion

Environment

- OS: Macos 14.4.1
- Flutter version: 3.13.3
- Is flutter in $PATH: yes
- neovim version: v0.10

Anything else?

No response

preiter93 avatar May 21 '24 15:05 preiter93