-
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
Typescript - add missing import #15309
Comments
@ddyrcz Can you please provide some example code? Also, is the file you are working with named |
From @ddyrcz on March 16, 2017 9:20 Sory I forgot the extension. Of course I meant app.module.ts I've create an sample git repository (it's just a new project generated with angular-cli 1.0.0-rc.1): You can clone this and try to reproduce. Steps:
In my case no missing import is adding |
I took a look at this on the VSCode side using the [email protected]. We do request the code fix for this error but get no response back:
Manually adding |
I suspect the import fix feature (if that's a good name for it) doesn't work well with package index files. Not sure if this is the same issue or not, but for example, if I use See: The conventional place which should have been in this list also is It would only know that That seems very suspiciously similar to this issue. Not 100% sure if it's the same issue or should be created separately. |
@Meligy I believe that's a distinct issue, see #15223 The root cause of this one, on the other hand, seems to be that the Add Missing Import codefix doesn't go searching in your node_modules for a module you haven't referenced at all before. It'll only suggest modules that are either a file in your project or previously imported by another file in your project. This is currently by design because we're not confident it will scale well, the way code fixes are currently implemented. If we can come up with an efficient design (perhaps have an explicitly user initiated step to look for more modules) we could consider fixing it. |
I'm failing to make sense of this because somehow it's looking for these paths: I have not imported from these. In this example I'd either have other imports from |
From @ddyrcz on March 15, 2017 7:7
Steps to Reproduce:
Copied from original issue: microsoft/vscode#22648
The text was updated successfully, but these errors were encountered: