microsoft / microsoft/TypeScript
VSCode version 1.58.2 Not able to add new imports in Typescript rush monorepos
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.4k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 117
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.58.2
- OS Version: macOS Big Sur 11.4
- Extension ids: [coenraads.bracket-pair-colorizer, wmaurer.change-case, streetsidesoftware.code-spell-checker, dbaeumer.vscode-eslint, file-icons.file-icons, eamodio.gitlens, esbenp.prettier-vscode, netcorext.uuid-generator, vscodevim.vim]
Steps to Reproduce:
- Create an interface Foo in a new location
- Create a class that depends on the Foo interface and try to auto import the definition through the VSCode auto import feature (highlight the interface and use
command + .to open the suggested actions) - The only option it will give the user if nothing has been imported from this location before is to extract to a type alias
- If something had been imported from the same location however, it can add the import to the existing list of imports
What should happen:
VSCode should suggest creating a new import statement for that interface at the top of the class file
What actually happens:
using command + . yields only the option to Extract to type alias.
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
Reproduce the problem in VS Code 1.58.2 using a TypeScript Rush monorepo, with extensions disabled, and compare a new import location with one already imported. Trace the TypeScript auto-import and suggested-actions behavior; done means Command+. offers an import statement for the interface while retaining existing import suggestions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100