Fix rename for type symbols imported as a different name (#37745)
* Add failing test * Fix getMeaningFromLocation for imports * Only the name of an ImportEqualsDeclaration counts * Commit baseline
This commit is contained in:
parent
72a0411776
commit
3810c2fe6b
|
@ -92,7 +92,11 @@ namespace ts {
|
|||
if (node.kind === SyntaxKind.SourceFile) {
|
||||
return SemanticMeaning.Value;
|
||||
}
|
||||
else if (node.parent.kind === SyntaxKind.ExportAssignment || node.parent.kind === SyntaxKind.ExternalModuleReference) {
|
||||
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) {
|
||||
return SemanticMeaning.All;
|
||||
}
|
||||
else if (isInRightSideOfInternalImportEqualsDeclaration(node)) {
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
/*====== /tests/cases/fourslash/canada.ts ======*/
|
||||
|
||||
export interface [|RENAME|] {}
|
||||
|
||||
/*====== /tests/cases/fourslash/dry.ts ======*/
|
||||
|
||||
import { RENAME as Ale } from './canada';
|
|
@ -0,0 +1,9 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @Filename: canada.ts
|
||||
////export interface /**/Ginger {}
|
||||
|
||||
// @Filename: dry.ts
|
||||
////import { Ginger as Ale } from './canada';
|
||||
|
||||
verify.baselineRename("", {});
|
Loading…
Reference in a new issue