@@ -377,19 +377,26 @@ namespace ts.FindAllReferences.Core {
377
377
378
378
const result : SymbolAndEntries [ ] = [ ] ;
379
379
const state = new State ( sourceFiles , /*isForConstructor*/ node . kind === SyntaxKind . ConstructorKeyword , checker , cancellationToken , searchMeaning , options , result ) ;
380
- const search = state . createSearch ( node , symbol , /*comingFrom*/ undefined , { allSearchSymbols : populateSearchSymbolSet ( symbol , node , checker , options . implementations ) } ) ;
381
380
382
- // Try to get the smallest valid scope that we can limit our search to;
383
- // otherwise we'll need to search globally (i.e. include each file).
384
- const scope = getSymbolScope ( symbol ) ;
385
- if ( scope ) {
386
- getReferencesInContainer ( scope , scope . getSourceFile ( ) , search , state ) ;
381
+ if ( node . kind === SyntaxKind . DefaultKeyword ) {
382
+ addReference ( node , symbol , node , state ) ;
383
+ searchForImportsOfExport ( node , symbol , { exportingModuleSymbol : symbol . parent , exportKind : ExportKind . Default } , state ) ;
387
384
}
388
385
else {
389
- // Global search
390
- for ( const sourceFile of state . sourceFiles ) {
391
- state . cancellationToken . throwIfCancellationRequested ( ) ;
392
- searchForName ( sourceFile , search , state ) ;
386
+ const search = state . createSearch ( node , symbol , /*comingFrom*/ undefined , { allSearchSymbols : populateSearchSymbolSet ( symbol , node , checker , options . implementations ) } ) ;
387
+
388
+ // Try to get the smallest valid scope that we can limit our search to;
389
+ // otherwise we'll need to search globally (i.e. include each file).
390
+ const scope = getSymbolScope ( symbol ) ;
391
+ if ( scope ) {
392
+ getReferencesInContainer ( scope , scope . getSourceFile ( ) , search , state ) ;
393
+ }
394
+ else {
395
+ // Global search
396
+ for ( const sourceFile of state . sourceFiles ) {
397
+ state . cancellationToken . throwIfCancellationRequested ( ) ;
398
+ searchForName ( sourceFile , search , state ) ;
399
+ }
393
400
}
394
401
}
395
402
0 commit comments