microsoft / microsoft/TypeScript
Enable auto imports and add missing import for module/package names
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 117
Description
Suggestion
🔍 Search Terms
- auto import
- quick fix
- missing import
⭐ Suggestion
Auto imports / add missing imports should be able to add import * as XYZ from 'XYZ' when triggered on the symbol name XYZ in a file. This is useful if you prefer using namespace imports and can also help with discovering/exploring new packages
Right now we have auto imports and an add missing import quick fix for symbols in a module, but I don't see these options for the module itself
📃 Motivating Example
- In a new project
npm I @types/vscode- Open new TS file and write
vscode.
Right now I don't get an auto import for vscode. I'd expect an import that adds: import * as vscode from 'vscode';
at the top of the file
💻 Use Cases
- Make it easier to reference a symbol if you prefer using namespaces from the start
- Helping users explore new packages (just type
vscode.to see suggestions in thevscodepackage) - Working with node packages. It'd be nice to be able to type
fs.to get anfsimport - Fixing code that has been copy and pasted between files
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named. Start by reproducing the TypeScript example with vscode. and compare the existing auto-import and add-missing-import behavior for symbols. Done means a module name can trigger a namespace import such as import * as vscode from 'vscode'; in the scenarios described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100