microsoft / microsoft/TypeScript

@import suggestions for auto-imports in VS Code

Open
#59,935 1 comment 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Awaiting More Feedback Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

🔍 Search Terms

@import, auto-import, JSDoc

✅ Viability Checklist
⭐ Suggestion

Taken from a chat with @andrewbranch:

When working a JS codebase, it's common to want to import types. As of TS 5.5 we have the JSDoc @import tag which is wonderful!

However, VS Code does not offer it as an option for auto imports. Consider the following help menu:

image

I like the Change 'Customer' to 'import... suggestion, what I'd like even more would be a suggestion to Add /** @import {Customer} from ...

📃 Motivating Example

It doesn't improve the language. It improves the developer experience of JSDoc.

💻 Use Cases
  1. What do you want to use this for?
    Working in VS Code more effectively.
  2. What shortcomings exist with current approaches?
    Current suggestions are more verbose.
  3. What workarounds are you using in the meantime?
    Writing imports by hand.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the existing VS Code auto-import help menu and the “Change 'Customer'...” suggestion described in the issue. Trace how that suggestion is produced for JavaScript files, then add a corresponding JSDoc @import option and verify it appears for the motivating type-import case.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript, vscode
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.