Raised by @BendixMa at Dart-Code/Dart-Code#2208. I can repro this on v2.8.0-dev, it seems like a server issue.
Hey,
when I declare a dart extension like so:
extension StringExtensions on String {
bool get definitelyNotAnInt => false;
void dontShowThisFunctionOnAnInt() {}
}
and use it subsequently in code like so:
main(List<String> args) {
int integer = 0;
integer. // and let vs-code show autocompletions here
}
then the suggestion list will include the extensions declared on the String
class as shown below.
Especially when you have multiple extensions declared on multiple types than this will quickly make autocompletion almost useless as there are so many unrelated suggestions and you cannot find the functions/fields in the list that the class actually defines.
I broke it 🙁
https://dart-review.googlesource.com/c/sdk/+/129334
https://dart-review.googlesource.com/c/sdk/+/131204 will add a new test, and restore the check.