Microsoft/TypeScript
Voir sur GitHub[Rename symbol command] Remove unnecessary named import
Open
#56 497 ouverte le 21 nov. 2023
Effort: CasualExperience EnhancementHelp WantedSuggestion
Métriques du dépôt
- Stars
- (48 455 stars)
- Métriques de merge PR
- (Merge moyen 6j 17h) (9 PRs mergées en 30 j)
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".