-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Suggest: auto-import often not working #109439
Comments
Slightly related: I often see something similar when I invoke quick fix on a missing type. At first I get no help and then trying again I get the advice to add the import. |
@jrieken The root cause of this issue is that
I think my solution works, but it's quite ugly. Ideally TypeScript could eagerly returns all of the information we need to implement auto-imports, although they had concerns about how long that would take to compute and send over |
This is arguably a bug. We shouldn't do that when we have explicitly called resolve during insert.
I am not quite sure why you need to know that. There should be an editor guarantee that resolve is only called once and the provider should resolve the item independent of the editor state. Tho, that's the ideal view but IDK how the reality of a provider is. What am I missing? |
…e completion before it has been resolved Fixes microsoft#109439 This introduces a new `ApplyCompletionCommand` that is included on all JS/TS completions, which applies additional parts of the completion (such as auto imports). This is needed since VS Code will not always wait until `resolveCompletionItem` completes before appling the completion. This causes auto imports to sometimes not work when typing quickly
…e completion before it has been resolved Fixes microsoft#109439 This introduces a new `ApplyCompletionCommand` that is included on all JS/TS completions, which applies additional parts of the completion (such as auto imports). This is needed since VS Code will not always wait until `resolveCompletionItem` completes before appling the completion. This causes auto imports to sometimes not work when typing quickly
@bpasero Looks like you are using the add missing import quick fix after typing out |
I'd prefer splitting any problem with quick fixes to their own issue as they are a separate feature |
Yes I press |
Ok, I've extracted the quick fix issue to #117812. Let's track auto imports suggestions in this issue. I believe auto import suggestion should be much more reliable now so please let me know if there are cases where you still see this |
I'm having same issue . Big Sur. Vs code Version: 1.54.1. I can wait 5 minutes and it doesnt work. 2021-03-09.17.00.24.mov |
@olegKusov Please open a separate issue with an example project that demonstrates the problem |
For Typescript I have similar issue, which happens completely random. Restarting VSC fixes behavior. Somehow it fixes itself
I've scanned through logs and found this in
I noticed something important: for whatever reason in |
@soanvig Please don't post on generic, already resolved issues You are using an old TS version so first check if you see this using TS 4.2+. If you do, open a new issue with a project that demonstrates the problem |
I very often have to manually import a type because suggest was not fast enough to do the auto import. I feel this happens more for me in web than in desktop:
I am always picking the suggestion fast enough that I end up just with the word but not the auto import.
The text was updated successfully, but these errors were encountered: