@@ -231,9 +231,9 @@ function walkIdentifiers(
231
231
processFunction ( ts , prop , ast , cb , ctx ) ;
232
232
}
233
233
}
234
- } else if ( ts . isTypeReferenceNode ( node ) ) {
234
+ } else if ( ts . isTypeNode ( node ) ) {
235
235
// fix https://github.com/vuejs/language-tools/issues/1422
236
- ts . forEachChild ( node , node => walkIdentifiersInTypeReference ( ts , node , cb ) ) ;
236
+ walkIdentifiersInTypeNode ( ts , node , cb ) ;
237
237
} else {
238
238
const _blockVars = blockVars ;
239
239
if ( ts . isBlock ( node ) ) {
@@ -280,15 +280,19 @@ function processFunction(
280
280
}
281
281
}
282
282
283
- function walkIdentifiersInTypeReference (
283
+ function walkIdentifiersInTypeNode (
284
284
ts : typeof import ( 'typescript' ) ,
285
285
node : ts . Node ,
286
286
cb : ( varNode : ts . Identifier , isShorthand : boolean ) => void ,
287
287
) {
288
- if ( ts . isTypeQueryNode ( node ) && ts . isIdentifier ( node . exprName ) ) {
289
- cb ( node . exprName , false ) ;
288
+ if ( ts . isTypeQueryNode ( node ) ) {
289
+ let id = node . exprName ;
290
+ while ( ! ts . isIdentifier ( id ) ) {
291
+ id = id . left ;
292
+ }
293
+ cb ( id , false ) ;
290
294
} else {
291
- ts . forEachChild ( node , node => walkIdentifiersInTypeReference ( ts , node , cb ) ) ;
295
+ ts . forEachChild ( node , node => walkIdentifiersInTypeNode ( ts , node , cb ) ) ;
292
296
}
293
297
}
294
298
0 commit comments