@@ -99,6 +99,9 @@ namespace ts.FindAllReferences {
9999 }
100100 break ;
101101
102+ case SyntaxKind . Identifier : // for 'const x = require("y");
103+ break ; // TODO: GH#23879
104+
102105 case SyntaxKind . ImportEqualsDeclaration :
103106 handleNamespaceImport ( direct , direct . name , hasModifier ( direct , ModifierFlags . Export ) ) ;
104107 break ;
@@ -130,6 +133,19 @@ namespace ts.FindAllReferences {
130133 directImports . push ( direct ) ;
131134 }
132135 break ;
136+
137+ case SyntaxKind . ImportType :
138+ if ( direct . qualifier ) {
139+ // `import("foo").x` named import
140+ directImports . push ( direct ) ;
141+ }
142+ else {
143+ // TODO: GH#23879
144+ }
145+ break ;
146+
147+ default :
148+ Debug . assertNever ( direct , `Unexpected import kind: ${ Debug . showSyntaxKind ( direct ) } ` ) ;
133149 }
134150 }
135151 }
@@ -216,6 +232,9 @@ namespace ts.FindAllReferences {
216232 }
217233
218234 if ( decl . kind === SyntaxKind . ImportType ) {
235+ if ( decl . qualifier ) { // TODO: GH#23879
236+ singleReferences . push ( decl . qualifier . kind === SyntaxKind . Identifier ? decl . qualifier : decl . qualifier . right ) ;
237+ }
219238 return ;
220239 }
221240
@@ -313,16 +332,10 @@ namespace ts.FindAllReferences {
313332 const namespaceImportSymbol = checker . getSymbolAtLocation ( name ) ;
314333
315334 return forEachPossibleImportOrExportStatement ( sourceFileLike , statement => {
316- if ( statement . kind !== SyntaxKind . ExportDeclaration ) return ;
317-
318- const { exportClause, moduleSpecifier } = statement as ExportDeclaration ;
319- if ( moduleSpecifier || ! exportClause ) return ;
320-
321- for ( const element of exportClause . elements ) {
322- if ( checker . getExportSpecifierLocalTargetSymbol ( element ) === namespaceImportSymbol ) {
323- return true ;
324- }
325- }
335+ if ( ! isExportDeclaration ( statement ) ) return ;
336+ const { exportClause, moduleSpecifier } = statement ;
337+ return ! moduleSpecifier && exportClause &&
338+ exportClause . elements . some ( element => checker . getExportSpecifierLocalTargetSymbol ( element ) === namespaceImportSymbol ) ;
326339 } ) ;
327340 }
328341
@@ -485,6 +498,9 @@ namespace ts.FindAllReferences {
485498 else if ( isBinaryExpression ( parent . parent ) ) {
486499 return getSpecialPropertyExport ( parent . parent , /*useLhsSymbol*/ true ) ;
487500 }
501+ else if ( isJSDocTypedefTag ( parent ) ) {
502+ return exportInfo ( symbol , ExportKind . Named ) ;
503+ }
488504 }
489505
490506 function getExportAssignmentExport ( ex : ExportAssignment ) : ExportedSymbol {
0 commit comments