Skip to content

JS/TS auto-import is not as good as Webstorm's #36816

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

Closed
darkbasic opened this issue Feb 13, 2020 · 4 comments
Closed

JS/TS auto-import is not as good as Webstorm's #36816

darkbasic opened this issue Feb 13, 2020 · 4 comments
Assignees
Labels
Duplicate An existing issue was already created

Comments

@darkbasic
Copy link

darkbasic commented Feb 13, 2020

TS Template added by @mjbvz

TypeScript Version: 3.7.5

Search Terms

  • auto import
  • auto imports

  • VSCode Version: 1.42.0
  • OS Version: Arch Linux amd64

Steps to Reproduce:

  1. npm install graphql-tools
  2. Try to auto-import makeExecutableSchema

It will say No code actions available, but if you manually import it then it works:

import { makeExecutableSchema } from 'graphql-tools';

The same function gets automatically imported in Webstorm.

Some auto-imports do work in vscode, like join:

import { join } from 'path';

but not all of them.

Does this issue occur when all extensions are disabled?: Yes

@mjbvz mjbvz transferred this issue from microsoft/vscode Feb 15, 2020
@mjbvz
Copy link
Contributor

mjbvz commented Feb 15, 2020

Here's what I see in VS Code insiders in a new project:

Screen Shot 2020-02-14 at 4 39 58 PM

Accepting the suggestion adds the import.

Do auto import suggestions work for you? Is it just the lightbulb that doesn't? The lightbulb for auto imports are only enabled if you enable semantic checking in your JavaScript

@DanielRosenwasser DanielRosenwasser added the Needs More Info The issue still hasn't been fully clarified label Feb 15, 2020
@darkbasic
Copy link
Author

@mjbvz in this particular example you're right: makeExecutableSchema gets the import suggestion when you type it, but it was taking so much time to display it that I didn't notice.

BUT other imports still don't get the suggestion, like for example MikroORM.
If you kindly help vscode adding the following to the beginning of your file

import {} from 'mikro-orm';

then it will manage to suggest MikroORM when you type it, otherwise it will display no suggestions at all.

@andrewbranch
Copy link
Member

Duplicate of #36042

@andrewbranch andrewbranch marked this as a duplicate of #36042 Feb 26, 2020
@andrewbranch andrewbranch added Duplicate An existing issue was already created and removed Needs More Info The issue still hasn't been fully clarified labels Feb 26, 2020
@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

5 participants