sdk
sdk copied to clipboard
Analyzer completion doesn't always suggest top-level methods in imported library
Say I have these 2 files:
main.dart:
import "lib.dart";
void main() {
print(calculate());
}
and lib.dart:
int calculate() {
return 6 * 7;
}
int calculateSomethingElse() {
return 7 * 7;
}
I then in main want to calculate something else, so I ask for completions at the ^:
import "lib.dart";
void main() {
print(calculate^());
}
I'm told "No suggestions". I remember it's called "calculateSomething" (and then some more) so I start typing
import "lib.dart";
void main() {
print(calculateSomething^());
}
I'm told "No suggestions".
Only if I remove the parenthesis (i.e. makes it not a call) does it suggest calculateSomethingElse.