microsoft / microsoft/TypeScript
[Rename symbol command] Remove unnecessary named import
Open
Nobody has claimed this yet.
Effort: Casual
Experience Enhancement
Help Wanted
Suggestion
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 117
Description
- VS Code Version: 1.84.2 (1a5daa3a0231a0fbba4f14db7ec463cf99d7768e)
- OS Version: macOS Sonoma 14.1.1
Steps to Reproduce:
- Create 2 JS files:
// utils.js export const foo = () => console.log('Hello world!');// index.js import { foo as bar } from "./utils.js"; bar();
- Put your cursor in the word "foo" in utils.js and use the "Rename Symbol" command (
F2by default) to rename the function tobar. - Observe the import in index.js has changed to
import { bar as bar } from "./utils.js". Since the names import is no longer necessary, the command should instead change the import toimport { bar } from "./utils.js".
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 Rename Symbol command with the two JavaScript files named utils.js and index.js, using F2 to rename foo to bar. Trace the rename flow from that command and verify that the completed import in index.js is import { bar } from "./utils.js" rather than retaining the redundant alias.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100