From cc386d25a40e55bacc6f40fd937e08862d055c2c Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Tue, 20 Feb 2018 14:35:01 -0800 Subject: [PATCH] Filter FAR results to initial SourceFile --- src/services/organizeImports.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/organizeImports.ts b/src/services/organizeImports.ts index 4a03864207e..7f54d80e79d 100644 --- a/src/services/organizeImports.ts +++ b/src/services/organizeImports.ts @@ -119,7 +119,7 @@ namespace ts.OrganizeImports { const entries = FindAllReferences.getReferenceEntriesForNode(identifier.pos, identifier, program, [sourceFile], { isCancellationRequested: () => false, throwIfCancellationRequested: () => { /*noop*/ }, - }); + }).filter(e => e.type === "node" && e.node.getSourceFile() === sourceFile); return entries.length > 1; } }