microsoft / microsoft/TypeScript

Rename a symbol of a named export: Do not create export alias

Open
#29,026 20 comments 33 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

  • VSCode Version: 1.30
  • OS Version: Win 10

When I rename a symbol which is a named export in a module, then there is just an alias created in the module export (VS Code 1.30). What I would expect is that the symbol is renamed in the module export AND all in all modules that are importing it (that is the bevavior of 1.29.1). Or an option by which I can specify the old behavior. This feature is soo useful to rename a bunch of modules.

Release notes of 1.30 only include some rename changes for destructuring , but I did not have any destructuring in code.

Old (1.29.1):

vscode_1 29 1

New (1.30):

vscode_1 30

Does this issue occur when all extensions are disabled?: Yes, running clean versions of 1.30, 1.29.1

PS: Typescript 3.2.2 in both tests.

// EDIT:

Actually, after all VS Code 1.29.1 did use Typescript 3.1.4 in the first test, not 3.2.2. Switching to TS 3.2.2 with the old 1.29.1 version, the same behavior (just aliasing the export instead of renaming in the whole workspace) reoccurs.
I am not sure, if there are interdependencies between VS Code and TS and therefore leave the issue open or not?

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 by reproducing the named-export rename in VS Code 1.30 with TypeScript 3.2.2, then compare it with the reported TypeScript 3.1.4 behavior from VS Code 1.29.1. The issue is resolved when renaming an exported symbol updates the export and importing modules instead of creating an alias.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
tooling
Issue type
Bug
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.