-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad autocompletion for type inside import alias when declaring a function inside a class #59865
Comments
I'm guessing that you're referring to the suggestion of Can you provide a small reproduction? |
@bwilkerson yes import 'package:image/image.dart' as img;
class A {
img.
} |
Hover when it is detected to be an alias: Hover Hover Hover EditSo @bwilkerson I`m not 100% sure this is an auto-complete issue necessarily but actually a parsing error which leads to this. Not sure if we have a tag for that. |
I think looking at this particular example |
I agree. We ought to have recovered well enough to be able to have reasonable suggestions there. I haven't had time to look into why completion is failing in this particular case, but I doubt it's because of a missing semicolon. |
@stephane-archer just so I'm clear, I agree. My comment was about it not identifying The parsing needs to identify it as an alias for the auto-completion to work. If you had for example: import 'package:image/image.dart' as img;
class A {
void foo(int img) { // I know this naming makes no sense but bear with me
img.^
}
} Inside The parser does the job of identifying what @bwilkerson I'll take a look at this when I have some time too. If I find anything I'll update it here. |
Technically, it isn't a parser problem. The parser only verifies that the code conforms to the grammar; it doesn't do any resolution, that's done by the resolver. But either way, completion should work even when there's incomplete information. |
@FMorschel I agree with you. In your example |
output.17.33.13.mov
The text was updated successfully, but these errors were encountered: