Vscode: Disable TS auto imports until they really work

Created on 16 Nov 2017  路  7Comments  路  Source: microsoft/vscode

  • VSCode Version: 1.18

Until Microsoft/TypeScript#19694 is fixed, the new TS auto imports feature should not be enabled by default. It produces wrong code, causing compilation failures.

I taught an Angular course this week, and that was a real mess because of this. People naturally select suggestions from the editor, and as the imports are on top of the file, it's often not visible directly, so people don't even notice the error, resulting in compilation errors.

typescript upstream

Most helpful comment

Agreed, this feature is majorly broken, even in non-TS projects. I have a React project that isn't using TS, and it kept inserting completely wrong import statements to the top of my files, without me realizing it, causing build errors.

All 7 comments

These can be disabled by setting: "typescript.autoImportSuggestions.enabled": false

TS 2.7 should fix the original issue as well

It is not a question about how to disable them, it is an issue about a feature enabled but currently broken and producing failing code, and with the corresponding PR to fix it (and I would argue it should be part of a 1.18.1 release).

In all case, even if the PR is not accepted, the issue should not be closed until it's really fixed.

I'm sorry you are hitting this bug but we are not going to rollback the feature because of this. Once the PR is merged upstream, you can pick up it up by installing typescript@next in your workspace: https://code.visualstudio.com/Docs/languages/typescript#_using-newer-typescript-versions

If we're waiting for upstream, how will it be fixed in 1.19 ? The upstream issue as been labeled "TypeScript 2.7" which is only planned in January 2018.

Agreed, this feature is majorly broken, even in non-TS projects. I have a React project that isn't using TS, and it kept inserting completely wrong import statements to the top of my files, without me realizing it, causing build errors.

Agreed, this feature is just messing with my imports, I missed many imports of foreach from angular and others, probably this should be disable by default.

@mjbvz Is this still planned for December edition ? Because we're close to release and it's still not working in Insiders, and the fix in TypeScript wasn't included in TS 2.6.2.

If it's not, it would seem really incomprehensible to me to let a feature that produces broken code for another several months (as TS 2.7 will only be available in January, meaning it could have to wait for the VS Code February release). Just look at the number of issues opened about this in TS repo and this one...

Was this page helpful?
0 / 5 - 0 ratings