Skip to content

Allow imports with the same names as global types to be moved by refactoring - #60410

Closed
Mateusz Burzyński (Andarist) wants to merge 1 commit into
microsoft:mainfrom
Andarist:fix/move-import-with-same-names-as-globals
Closed

Allow imports with the same names as global types to be moved by refactoring#60410
Mateusz Burzyński (Andarist) wants to merge 1 commit into
microsoft:mainfrom
Andarist:fix/move-import-with-same-names-as-globals

Conversation

@Andarist

Copy link
Copy Markdown
Contributor

@typescript-botTypeScript Bot (typescript-bot) added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Nov 4, 2024
]);
}
else if (isTopLevelDeclaration(decl) && sourceFileOfTopLevelDeclaration(decl) === oldFile && !movedSymbols.has(symbol)) {
else if (!isGlobalType(checker, symbol) && isTopLevelDeclaration(decl) && sourceFileOfTopLevelDeclaration(decl) === oldFile && !movedSymbols.has(symbol)) {

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is perfect but, at the very least, it's no worse than the previous version. The preceding branch already handles isInImport(decl) and those should always be moveable. So I just pushed the existing check further down the road so the preceding branch can kick in in the case that is being fixed here.

@iisaduanIsabel Duan (iisaduan)Nov 7, 2024

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Andrew Branch (@andrewbranch) What do you think of this vs #60173, I think it is the same bug

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Fix AvailableA PR has been opened for this issueFor Uncommitted BugPR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Move to a new file" refactor was recently broken for some import names

4 participants

@Andarist@iisaduan@sandersn@typescript-bot