-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Potentially incompatible/unsupported import statements added to code by default #38773
Comments
You can disable auto imports by setting Can you please provide an example of where the import being added incorrectly? |
Thanks a lot! I'm not sure what controls this behavior. As in, what modules it suggests for auto-import. This just started happening in projects where it didn't happen before. These are NodeJS projects, but I don't know how Code identifies those. But this happens in all the projects I'm working on. I've tried to reproduce this in https://github.com/villadora/express-bunyan-logger because I have it open right now and it happens there as well: IMHO there are many things wrong with the current approach. The most important one being that it is enabled by default. |
|
My best auto import so far |
Related but not the same: I've requested the entire feature be disabled. I can't see why anyone could want this behavior by default, even if the imports made any sense (which, yep, they usually don't). |
Opened microsoft/TypeScript#20292 to track using require for auto imports and the import being inserted in the wrong location relative to existing requires. |
(2 theme extensions excluded)
Steps to Reproduce:
re
and press Enter.read
fromfs
.Even if we wanted this behavior, the import statement is inserted at the wrong location and violates our style rules.
import
is also only at experimental support level in Node (behind a flag), so I really don't understand this behavior.The text was updated successfully, but these errors were encountered: