@@ -393,7 +393,21 @@ public SearchResult FollowIncomingCallsHeuristically(string id)
393
393
394
394
if ( element . ElementType == CodeElementType . Method )
395
395
{
396
-
396
+ // 1. Abstractions (priority 0)
397
+ // For methods the abstractions like interfaces may be called.
398
+ var abstractions = allImplementsAndOverrides . Where ( d => d . SourceId == element . Id ) . ToArray ( ) ;
399
+ foundRelationships . UnionWith ( abstractions ) ;
400
+ var abstractionTargets = abstractions . Select ( d => _codeGraph . Nodes [ d . TargetId ] ) . ToHashSet ( ) ;
401
+ foundElements . UnionWith ( abstractionTargets ) ;
402
+ AddToProcessingQueue ( abstractionTargets , currentContext , 2 ) ;
403
+
404
+
405
+ // Add Events that are handled by this method (priority 1).
406
+ var handles = allHandles . Where ( h => h . SourceId == element . Id ) . ToArray ( ) ;
407
+ foundRelationships . UnionWith ( handles ) ;
408
+ var events = handles . Select ( h => _codeGraph . Nodes [ h . TargetId ] ) . ToHashSet ( ) ;
409
+ foundElements . UnionWith ( events ) ;
410
+ AddToProcessingQueue ( events , currentContext , 2 ) ;
397
411
398
412
399
413
// 3. Calls (priority 2)
@@ -425,21 +439,7 @@ public SearchResult FollowIncomingCallsHeuristically(string id)
425
439
AddToProcessingQueue ( [ callSource ] , currentContext , 2 ) ;
426
440
}
427
441
428
- // 1. Abstractions (priority 0)
429
- // For methods the abstractions like interfaces may be called.
430
- var abstractions = allImplementsAndOverrides . Where ( d => d . SourceId == element . Id ) . ToArray ( ) ;
431
- foundRelationships . UnionWith ( abstractions ) ;
432
- var abstractionTargets = abstractions . Select ( d => _codeGraph . Nodes [ d . TargetId ] ) . ToHashSet ( ) ;
433
- foundElements . UnionWith ( abstractionTargets ) ;
434
- AddToProcessingQueue ( abstractionTargets , currentContext , 2 ) ;
435
-
436
-
437
- // Add Events that are handled by this method (priority 1).
438
- var handles = allHandles . Where ( h => h . SourceId == element . Id ) . ToArray ( ) ;
439
- foundRelationships . UnionWith ( handles ) ;
440
- var events = handles . Select ( h => _codeGraph . Nodes [ h . TargetId ] ) . ToHashSet ( ) ;
441
- foundElements . UnionWith ( events ) ;
442
- AddToProcessingQueue ( events , currentContext , 2 ) ;
442
+
443
443
444
444
445
445
}
0 commit comments