@@ -524,17 +524,17 @@ abstract class ImplOrTraitItemNode extends ItemNode {
524
524
525
525
pragma [ nomagic]
526
526
private TypeParamItemNode resolveTypeParamPathTypeRepr ( PathTypeRepr ptr ) {
527
- result = resolvePathFull ( ptr .getPath ( ) )
527
+ result = resolvePath ( ptr .getPath ( ) )
528
528
}
529
529
530
530
class ImplItemNode extends ImplOrTraitItemNode instanceof Impl {
531
531
Path getSelfPath ( ) { result = super .getSelfTy ( ) .( PathTypeRepr ) .getPath ( ) }
532
532
533
533
Path getTraitPath ( ) { result = super .getTrait ( ) .( PathTypeRepr ) .getPath ( ) }
534
534
535
- ItemNode resolveSelfTy ( ) { result = resolvePathFull ( this .getSelfPath ( ) ) }
535
+ ItemNode resolveSelfTy ( ) { result = resolvePath ( this .getSelfPath ( ) ) }
536
536
537
- TraitItemNode resolveTraitTy ( ) { result = resolvePathFull ( this .getTraitPath ( ) ) }
537
+ TraitItemNode resolveTraitTy ( ) { result = resolvePath ( this .getTraitPath ( ) ) }
538
538
539
539
override AssocItemNode getAnAssocItem ( ) { result = super .getAssocItemList ( ) .getAnAssocItem ( ) }
540
540
@@ -733,7 +733,7 @@ class TraitItemNode extends ImplOrTraitItemNode instanceof Trait {
733
733
}
734
734
735
735
pragma [ nomagic]
736
- ItemNode resolveABound ( ) { result = resolvePathFull ( this .getABoundPath ( ) ) }
736
+ ItemNode resolveABound ( ) { result = resolvePath ( this .getABoundPath ( ) ) }
737
737
738
738
override AssocItemNode getAnAssocItem ( ) { result = super .getAssocItemList ( ) .getAnAssocItem ( ) }
739
739
@@ -872,7 +872,7 @@ class TypeParamItemNode extends ItemNode instanceof TypeParam {
872
872
}
873
873
874
874
pragma [ nomagic]
875
- ItemNode resolveABound ( ) { result = resolvePathFull ( this .getABoundPath ( ) ) }
875
+ ItemNode resolveABound ( ) { result = resolvePath ( this .getABoundPath ( ) ) }
876
876
877
877
/**
878
878
* Holds if this type parameter has a trait bound. Examples:
@@ -1285,14 +1285,9 @@ private predicate pathUsesNamespace(Path p, Namespace n) {
1285
1285
)
1286
1286
}
1287
1287
1288
- /**
1289
- * Gets the item that `path` resolves to, if any.
1290
- *
1291
- * Whenever `path` can resolve to both a function in source code and in library
1292
- * code, both are included
1293
- */
1294
- pragma [ nomagic]
1295
- private ItemNode resolvePathFull ( RelevantPath path ) {
1288
+ /** Gets the item that `path` resolves to, if any. */
1289
+ cached
1290
+ ItemNode resolvePath ( RelevantPath path ) {
1296
1291
exists ( Namespace ns | result = resolvePath0 ( path , ns ) |
1297
1292
pathUsesNamespace ( path , ns )
1298
1293
or
@@ -1301,30 +1296,9 @@ private ItemNode resolvePathFull(RelevantPath path) {
1301
1296
)
1302
1297
}
1303
1298
1304
- pragma [ nomagic]
1305
- private predicate resolvesSourceFunction ( RelevantPath path ) {
1306
- resolvePathFull ( path ) .( Function ) .fromSource ( )
1307
- }
1308
-
1309
- /** Gets the item that `path` resolves to, if any. */
1310
- cached
1311
- ItemNode resolvePath ( RelevantPath path ) {
1312
- result = resolvePathFull ( path ) and
1313
- (
1314
- // when a function exists in both source code and in library code, it is because
1315
- // we also extracted the source code as library code, and hence we only want
1316
- // the function from source code
1317
- result .fromSource ( )
1318
- or
1319
- not result instanceof Function
1320
- or
1321
- not resolvesSourceFunction ( path )
1322
- )
1323
- }
1324
-
1325
1299
pragma [ nomagic]
1326
1300
private ItemNode resolvePathQualifier ( RelevantPath path , string name ) {
1327
- result = resolvePathFull ( path .getQualifier ( ) ) and
1301
+ result = resolvePath ( path .getQualifier ( ) ) and
1328
1302
name = path .getText ( )
1329
1303
}
1330
1304
@@ -1370,7 +1344,7 @@ private ItemNode resolveUseTreeListItemQualifier(
1370
1344
pragma [ nomagic]
1371
1345
private ItemNode resolveUseTreeListItem ( Use use , UseTree tree ) {
1372
1346
tree = use .getUseTree ( ) and
1373
- result = resolvePathFull ( tree .getPath ( ) )
1347
+ result = resolvePath ( tree .getPath ( ) )
1374
1348
or
1375
1349
result = resolveUseTreeListItem ( use , tree , tree .getPath ( ) )
1376
1350
}
0 commit comments