Dart-code: Autocomplete not working as expected

Created on 2 Feb 2021  ·  3Comments  ·  Source: Dart-Code/Dart-Code

Describe the bug
Autocomplete not working as expected.

To Reproduce
Selecting a property that expects a Function into a Widget does not automatically suggest the property callback implementation anymore.
Selecting Navigator.pop from the list does not close parentheses and automatically add context inside... And many more issues...

Expected behavior
On selecting a property from the suggestion list automatically show possible implementation for that callback (normal function and arrow function implementations).
Selecting Navigator.of or Scaffold.of should automatically close parentheses for this method and add context on it.

Screenshots
Here is a preview of the issue: https://youtu.be/QT11KC9U2uk

Versions (please complete the following information):

Most helpful comment

Did you recently enable LSP?

If so, I think this may be https://github.com/Dart-Code/Dart-Code/issues/2823 / https://github.com/Dart-Code/Dart-Code/issues/2992. In the current Flutter stable branch, there's a setting (dart.completeFunctionCalls) that is not yet supported. This has been implemented and should be in the next Flutter stable update.

In the meantime, if you would like this feature you can disable the "Preview LSP" setting in VS Code and reload, and that should return to the previous behaviour you had.

All 3 comments

Did you recently enable LSP?

If so, I think this may be https://github.com/Dart-Code/Dart-Code/issues/2823 / https://github.com/Dart-Code/Dart-Code/issues/2992. In the current Flutter stable branch, there's a setting (dart.completeFunctionCalls) that is not yet supported. This has been implemented and should be in the next Flutter stable update.

In the meantime, if you would like this feature you can disable the "Preview LSP" setting in VS Code and reload, and that should return to the previous behaviour you had.

@DanTup this was the problem. Thank you for the quick answer!

Great! After the next Flutter stable release, I'll likely re-show the LSP prompt to everyone so if you see it pop up again, you should be able to opt-in and set the dart.completeFunctionCalls setting (you could even enable that now) and then you should continue to see that behaviour for LSP too.

Some time after, LSP will become the default (and ultimately, the only option). Thanks!

Was this page helpful?
0 / 5 - 0 ratings