@@ -524,17 +524,17 @@ abstract class ImplOrTraitItemNode extends ItemNode {
524524
525525pragma [ nomagic]
526526private TypeParamItemNode resolveTypeParamPathTypeRepr ( PathTypeRepr ptr ) {
527- result = resolvePathFull ( ptr .getPath ( ) )
527+ result = resolvePath ( ptr .getPath ( ) )
528528}
529529
530530class ImplItemNode extends ImplOrTraitItemNode instanceof Impl {
531531 Path getSelfPath ( ) { result = super .getSelfTy ( ) .( PathTypeRepr ) .getPath ( ) }
532532
533533 Path getTraitPath ( ) { result = super .getTrait ( ) .( PathTypeRepr ) .getPath ( ) }
534534
535- ItemNode resolveSelfTy ( ) { result = resolvePathFull ( this .getSelfPath ( ) ) }
535+ ItemNode resolveSelfTy ( ) { result = resolvePath ( this .getSelfPath ( ) ) }
536536
537- TraitItemNode resolveTraitTy ( ) { result = resolvePathFull ( this .getTraitPath ( ) ) }
537+ TraitItemNode resolveTraitTy ( ) { result = resolvePath ( this .getTraitPath ( ) ) }
538538
539539 override AssocItemNode getAnAssocItem ( ) { result = super .getAssocItemList ( ) .getAnAssocItem ( ) }
540540
@@ -733,7 +733,7 @@ class TraitItemNode extends ImplOrTraitItemNode instanceof Trait {
733733 }
734734
735735 pragma [ nomagic]
736- ItemNode resolveABound ( ) { result = resolvePathFull ( this .getABoundPath ( ) ) }
736+ ItemNode resolveABound ( ) { result = resolvePath ( this .getABoundPath ( ) ) }
737737
738738 override AssocItemNode getAnAssocItem ( ) { result = super .getAssocItemList ( ) .getAnAssocItem ( ) }
739739
@@ -872,7 +872,7 @@ class TypeParamItemNode extends ItemNode instanceof TypeParam {
872872 }
873873
874874 pragma [ nomagic]
875- ItemNode resolveABound ( ) { result = resolvePathFull ( this .getABoundPath ( ) ) }
875+ ItemNode resolveABound ( ) { result = resolvePath ( this .getABoundPath ( ) ) }
876876
877877 /**
878878 * Holds if this type parameter has a trait bound. Examples:
@@ -1285,14 +1285,9 @@ private predicate pathUsesNamespace(Path p, Namespace n) {
12851285 )
12861286}
12871287
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 ) {
12961291 exists ( Namespace ns | result = resolvePath0 ( path , ns ) |
12971292 pathUsesNamespace ( path , ns )
12981293 or
@@ -1301,30 +1296,9 @@ private ItemNode resolvePathFull(RelevantPath path) {
13011296 )
13021297}
13031298
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-
13251299pragma [ nomagic]
13261300private ItemNode resolvePathQualifier ( RelevantPath path , string name ) {
1327- result = resolvePathFull ( path .getQualifier ( ) ) and
1301+ result = resolvePath ( path .getQualifier ( ) ) and
13281302 name = path .getText ( )
13291303}
13301304
@@ -1370,7 +1344,7 @@ private ItemNode resolveUseTreeListItemQualifier(
13701344pragma [ nomagic]
13711345private ItemNode resolveUseTreeListItem ( Use use , UseTree tree ) {
13721346 tree = use .getUseTree ( ) and
1373- result = resolvePathFull ( tree .getPath ( ) )
1347+ result = resolvePath ( tree .getPath ( ) )
13741348 or
13751349 result = resolveUseTreeListItem ( use , tree , tree .getPath ( ) )
13761350}
0 commit comments