-
Notifications
You must be signed in to change notification settings - Fork 12.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
CodeFix for missing import should take into account main in package.json #13130
Comments
We try not to do disk lockups here. disk access in general is expensive. given a module, we do not know if it is referenced in package.json higher on or not. so we have to keep walking up and probing. |
the module resolution is a different process. let me explain. the compiler looks at imports in your file, and resolves them to files. this involves disk probing, etc.. it reads package.json, it looks up folders, etc.. you can see what is going on using the quickfix is trying to add an import that does not exist. so the information the compiler built during resolution is not useful here, as the import was not there. the issue is to compute the quickfix you could have the same name coming from multiple modules. and modules could be imported through multiple names, so the only option is to repeat the process of resolution for each proposed quickfix. and we would rather not do that. |
Oh i see, thank you so much for the explanation |
Tracking under #15223 |
package.json
ofantd
module:Files inside
antd
module:Ideally if import would be
Import Button from "antd"
The text was updated successfully, but these errors were encountered: