Skip to content

Fix rename for type symbols imported as a different name #37745

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 2, 2020

Conversation

andrewbranch
Copy link
Member

Fixes #37188

Comment on lines +95 to +99
else if (node.parent.kind === SyntaxKind.ExportAssignment
|| node.parent.kind === SyntaxKind.ExternalModuleReference
|| node.parent.kind === SyntaxKind.ImportSpecifier
|| node.parent.kind === SyntaxKind.ImportClause
|| isImportEqualsDeclaration(node.parent) && node === node.parent.name) {
Copy link
Member Author

Choose a reason for hiding this comment

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

The rename was bailing because it was calling getMeaningFromLocation on the import specifier’s identifier, and it was making it all the way to the bottom of the function, returning SemanticMeaning.Value. Seems like identifier serving as an import alias should be SemanticMeaning.All.

@andrewbranch andrewbranch merged commit 3810c2f into microsoft:master Apr 2, 2020
@andrewbranch andrewbranch deleted the bug/37188 branch April 2, 2020 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename does not update aliased imports
4 participants