Skip to content
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 quick fixes for import should suggest closer ones first #120313

Closed
bpasero opened this issue Apr 1, 2021 · 2 comments
Closed

TypeScript quick fixes for import should suggest closer ones first #120313

bpasero opened this issue Apr 1, 2021 · 2 comments
Assignees
Labels
papercut 🩸 A particularly annoying issue impacting someone on the team typescript Typescript support issues upstream-issue-linked This is an upstream issue that has been reported upstream

Comments

@bpasero
Copy link
Member

bpasero commented Apr 1, 2021

I often see TypeScript suggesting or auto-importing a type from a totally different module that is unrelated to my current one. Popular examples are Disposable and URI or here IProductConfiguration:

image

It would be great if TS could be smart and suggest the right import first based on where I am at. E.g. when I am in a vs/... module, do not suggest imports from vscode.d.ts or even xterm. And if there are multiple results like in the screenshot, suggest the one that is closest in distance.

@bpasero bpasero added typescript Typescript support issues papercut 🩸 A particularly annoying issue impacting someone on the team labels Apr 1, 2021
@bpasero
Copy link
Member Author

bpasero commented Apr 1, 2021

For Disposable:

image

@mjbvz
Copy link
Collaborator

mjbvz commented Apr 1, 2021

Falls under microsoft/TypeScript#41083

@mjbvz mjbvz closed this as completed Apr 1, 2021
@mjbvz mjbvz added the upstream-issue-linked This is an upstream issue that has been reported upstream label Apr 1, 2021
@github-actions github-actions bot locked and limited conversation to collaborators May 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
papercut 🩸 A particularly annoying issue impacting someone on the team typescript Typescript support issues upstream-issue-linked This is an upstream issue that has been reported upstream
Projects
None yet
Development

No branches or pull requests

2 participants