@@ -99,6 +99,9 @@ namespace ts.FindAllReferences {
99
99
}
100
100
break ;
101
101
102
+ case SyntaxKind . Identifier : // for 'const x = require("y");
103
+ break ; // TODO: GH#23879
104
+
102
105
case SyntaxKind . ImportEqualsDeclaration :
103
106
handleNamespaceImport ( direct , direct . name , hasModifier ( direct , ModifierFlags . Export ) ) ;
104
107
break ;
@@ -130,6 +133,19 @@ namespace ts.FindAllReferences {
130
133
directImports . push ( direct ) ;
131
134
}
132
135
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 ) } ` ) ;
133
149
}
134
150
}
135
151
}
@@ -216,6 +232,9 @@ namespace ts.FindAllReferences {
216
232
}
217
233
218
234
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
+ }
219
238
return ;
220
239
}
221
240
@@ -313,16 +332,10 @@ namespace ts.FindAllReferences {
313
332
const namespaceImportSymbol = checker . getSymbolAtLocation ( name ) ;
314
333
315
334
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 ) ;
326
339
} ) ;
327
340
}
328
341
@@ -485,6 +498,9 @@ namespace ts.FindAllReferences {
485
498
else if ( isBinaryExpression ( parent . parent ) ) {
486
499
return getSpecialPropertyExport ( parent . parent , /*useLhsSymbol*/ true ) ;
487
500
}
501
+ else if ( isJSDocTypedefTag ( parent ) ) {
502
+ return exportInfo ( symbol , ExportKind . Named ) ;
503
+ }
488
504
}
489
505
490
506
function getExportAssignmentExport ( ex : ExportAssignment ) : ExportedSymbol {
0 commit comments