@@ -243,6 +243,7 @@ import {
243243 getTokenAtPosition ,
244244 isBinaryOperatorToken ,
245245 TsPlusExtensionTag ,
246+ isTsPlusSymbol ,
246247} from "./_namespaces/ts" ;
247248import {
248249 createImportTracker ,
@@ -1024,26 +1025,26 @@ export namespace Core {
10241025 return moduleReferences ;
10251026 }
10261027
1027- // TSPLUS EXTENSION BEGIN
1028-
1029- let tsPlusDeclarationReferences : SymbolAndEntries [ ] = [ ]
1030- if ( symbol . valueDeclaration ) {
1031- for ( const extension of checker . getExtensionsForDeclaration ( symbol . valueDeclaration ) ) {
1032- tsPlusDeclarationReferences = concatenate (
1033- tsPlusDeclarationReferences ,
1034- getReferencedExtensionsForSymbol ( symbol , extension , undefined , sourceFiles , sourceFilesSet , checker , cancellationToken , options )
1035- ) ;
1036- }
1037- }
1038-
1039- // TSPLUS EXTENSION END
1040-
10411028 const aliasedSymbol = getMergedAliasedSymbolOfNamespaceExportDeclaration ( node , symbol , checker ) ;
10421029 const moduleReferencesOfExportTarget = aliasedSymbol &&
10431030 getReferencedSymbolsForModuleIfDeclaredBySourceFile ( aliasedSymbol , program , sourceFiles , cancellationToken , options , sourceFilesSet ) ;
10441031
10451032 const references = getReferencedSymbolsForSymbol ( symbol , node , sourceFiles , sourceFilesSet , checker , cancellationToken , options ) ;
1046- return mergeReferences ( program , moduleReferences , references , moduleReferencesOfExportTarget , tsPlusReferences , tsPlusDeclarationReferences ) ;
1033+ // TSPLUS EXTENSION BEGIN
1034+ if ( isTsPlusSymbol ( symbol ) ) {
1035+ let tsPlusDeclarationReferences : SymbolAndEntries [ ] = [ ]
1036+ if ( symbol . valueDeclaration ) {
1037+ for ( const extension of checker . getExtensionsForDeclaration ( symbol . valueDeclaration ) ) {
1038+ tsPlusDeclarationReferences = concatenate (
1039+ tsPlusDeclarationReferences ,
1040+ getReferencedExtensionsForSymbol ( symbol , extension , undefined , sourceFiles , sourceFilesSet , checker , cancellationToken , options )
1041+ ) ;
1042+ }
1043+ }
1044+ return mergeReferences ( program , moduleReferences , references , moduleReferencesOfExportTarget , tsPlusReferences , tsPlusDeclarationReferences ) ;
1045+ }
1046+ // TSPLUS EXTENSION END
1047+ return mergeReferences ( program , moduleReferences , references , moduleReferencesOfExportTarget ) ;
10471048 }
10481049
10491050 export function getAdjustedNode ( node : Node , options : Options ) {
0 commit comments