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] Future isn't a type

tudor07 opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Everywhere where I use Future I get this error:

Future isn't a type. Try correcting the name to match an existing type.

Expected Behavior

Future type should be recognised

Steps To Reproduce

This only happens after I upgraded to Flutter 3.10.5. It used to work on Flutter 3.7.12.
Just look at code using Future type using Flutter 3.10.5,

Environment

- OS: macOS Ventura 13.2
- Flutter version: 3.10.5
- Is flutter in $PATH: yes
- neovim version: 0.9.0

Anything else?

No response

Hi @tudor07,

what error you get or don't get is entirely a decision of the language server. this plugin is just a middleman it absolutely isn't responsible for the specific errors you see or don't see. I don't really have much advice other than to check if there are similar issues on the flutter/dart language server repository that might explain this.

@akinsho this does not happen in VS Code which uses the same LSP.

@tudor07 it's not really a 1:1 comparison between dart-code and this plugin so I think that vscode does or doesn't do something doesn't really relate very cleanly. In many cases vscode has a lot of adhoc or custom workarounds to the behaviour of language servers. It could just be that the author of that plugin is hiding the error or working around it. Also just as importantly I don't know what setting you are or are not using in your config so no idea if there is some deprecated setting or not.

@sidlatau are you experiencing an error like @tudor07 describes?

I am using the latest Flutter (3.10.5) and the latest plugin version and do not see any error messages mentioned in this issue. @tudor07 are you using FVM? I experienced that Flutter version resolution may not work in some monorepo setups (when FVM is in the root and I am using a package inside). Maybe that could be an issue?

@sidlatau I am not using FVM. Weird. This error appeared for me after upgrading to 3.10.5 and I didn't change anything else. I have latest version of flutter_tools.