Completions for Flutter (and other) libraries are missing if packages were fetched after opening the project
See original GitHub issueDuring a recent live stream, I noticed that I was having some performance issues (Opened a separate issue on this one). Due to an unrelated issue, I downgraded my flutter channel from dev to stable. After doing this, I noticed that any imported libraries were not receiving auto completion anymore. I went back up to dev after a day or two and I am still not receiving proper auto-completion for these imported libraries. Sometimes this even happens with Flutter libraries like Foundation and Cupertino.
I find that if I’ve already imported the library via pubspec and imported it into the file; I can close out of the editor and it will give me the expected auto-completion.
This is a bit of a strange issue in that it seems to be very selective. For instance, when I was working with the Android Alarm Manager library, typing in the object AndroidAlarmManager
did not give me auto-completion, however I was able to get auto completion for the attached methods/named constructors. Even typing in the object name again did not yield auto-completion either which again was a bit strange. On the other hand, a library like the http library didn’t have this problem. I can provide a log if needed; tomorrow, I plan to sit down and do some heavy coding.
Issue Analytics
- State:
- Created 4 years ago
- Comments:18 (11 by maintainers)
Top GitHub Comments
seems to be working on the dev branch with
1.6.3
.Trying the fix yourself right now is slightly complicated because you have to download a nightly Dart SDK and paste it over the one inside your Flutter SDK (which isn’t really recommended because it could cause other issues). I did to it on Flutter
master
to verify the fix though, and it does work as expected 😃Until the fix reaches whichever channel you’re on you can keep using those workarounds (disable, or reload), or you could switch to the
master
channel (which essentially is the same as"dart.autoImportCompletions": false
since the version we require to enable it was slightly newer than current stable).I think the SDK rolls into Flutter fairly frequently, so I expect the fix will make
master
within a few days, and probablydev
within a week or two. Once it hits master it’ll be clear which version it’s in (so it’s easier to tell when it makes dev).I’ll close this since it’s fixed, but feel free to ping if you have any questions (or open new issues if you have other problems). Thanks!