@@ -39,10 +39,9 @@ export class FileIndexer {
39
39
this . workingDirectoryRegExp = new RegExp ( options . cwd , 'g' )
40
40
}
41
41
public index ( ) : void {
42
- // Uncomment below if you want to skip certain files for local development.
43
- // if (!this.sourceFile.fileName.includes('infer-relation')) {
44
- // return
45
- // }
42
+ if ( this . options . shouldIndexFile ?.( this . sourceFile . fileName ) === false ) {
43
+ return
44
+ }
46
45
this . emitSourceFileOccurrence ( )
47
46
this . visit ( this . sourceFile )
48
47
}
@@ -172,6 +171,14 @@ export class FileIndexer {
172
171
: sym ?. declarations || [ ]
173
172
for ( const declaration of declarations ) {
174
173
let scipSymbol = this . scipSymbol ( declaration )
174
+ if ( scipSymbol . value === 'local 4' ) {
175
+ console . log ( {
176
+ node : node . getText ( ) ,
177
+ kind : ts . SyntaxKind [ node . kind ] ,
178
+ kind2 : ts . SyntaxKind [ node . parent . kind ] ,
179
+ kind3 : ts . SyntaxKind [ node . parent . parent . kind ] ,
180
+ } )
181
+ }
175
182
176
183
if (
177
184
( ( ts . isIdentifier ( node ) && ts . isNewExpression ( node . parent ) ) ||
@@ -399,6 +406,25 @@ export class FileIndexer {
399
406
}
400
407
return this . cached ( node , package_ )
401
408
}
409
+
410
+ if (
411
+ node ?. parent ?. parent &&
412
+ ts . isIdentifier ( node ) &&
413
+ ts . isMethodDeclaration ( node . parent ) &&
414
+ node . parent . name === node &&
415
+ ts . isObjectLiteralExpression ( node . parent . parent )
416
+ ) {
417
+ const tpe = this . assignedType . get ( node . parent . parent )
418
+ const property = tpe ?. getProperty ( node . getText ( ) )
419
+ console . log ( {
420
+ node : node . getText ( ) ,
421
+ tpe : tpe && this . checker . typeToString ( tpe ) ,
422
+ } )
423
+ if ( property ?. declarations && property . declarations . length > 0 ) {
424
+ return this . cached ( node , this . scipSymbol ( property . declarations [ 0 ] ) )
425
+ }
426
+ }
427
+
402
428
if (
403
429
ts . isPropertyAssignment ( node ) ||
404
430
ts . isShorthandPropertyAssignment ( node )
0 commit comments