Skip to content

Commit 9c2b95d

Browse files
committed
Make FAR handle non-existent imported symbols
1 parent 70e9a5e commit 9c2b95d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/services/findAllReferences.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ namespace ts.FindAllReferences.Core {
356356

357357
/** Core find-all-references algorithm for a normal symbol. */
358358
function getReferencedSymbolsForSymbol(symbol: Symbol, node: Node, sourceFiles: ReadonlyArray<SourceFile>, checker: TypeChecker, cancellationToken: CancellationToken, options: Options): SymbolAndEntries[] {
359-
symbol = skipPastExportOrImportSpecifierOrUnion(symbol, node, checker);
359+
symbol = skipPastExportOrImportSpecifierOrUnion(symbol, node, checker) || symbol;
360360

361361
// Compute the meaning from the location and the symbol it references
362362
const searchMeaning = getIntersectingMeaningFromDeclarations(getMeaningFromLocation(node), symbol.declarations);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/// <reference path='fourslash.ts'/>
2+
3+
////import { [|ab|] as [|cd|] } from "doesNotExist";
4+
5+
const [r0, r1] = test.ranges();
6+
verify.referencesOf(r0, [r1]);
7+
verify.referencesOf(r1, [r1]);

0 commit comments

Comments
 (0)