@@ -38,14 +38,9 @@ string computeScopePath(Scope scope) {
3838 result = scope .( Module ) .getName ( )
3939 else
4040 //recursive cases
41- if scope instanceof Class
41+ if scope instanceof Class or scope instanceof Function
4242 then
43- result = computeScopePath ( scope .( Class ) .getEnclosingScope ( ) ) + "." + scope .( Class ) .getName ( )
44- else
45- if scope instanceof Function
46- then
47- result =
48- computeScopePath ( scope .( Function ) .getEnclosingScope ( ) ) + "." + scope .( Function ) .getName ( )
43+ result = computeScopePath ( scope .getEnclosingScope ( ) ) + "." + scope .getName ( )
4944 else result = "unknown: " + scope .toString ( )
5045}
5146
@@ -72,19 +67,17 @@ module FindModel<modelSig/2 model> {
7267 */
7368 bindingset [ path, member]
7469 string possibleMemberPathPrefix ( string path , string member ) {
75- // functionName must be a substring of path
7670 exists ( int index | index = path .indexOf ( [ "Member" , "Method" ] + "[" + member + "]" ) |
7771 result = path .prefix ( index )
7872 )
7973 }
8074
8175 /**
82- * Holds if `(type,path)` evaluates to the given entity, when evalauted from a client of the current library .
76+ * Holds if `(type,path)` identifies `scope` .
8377 */
8478 bindingset [ type, path]
8579 predicate pathToScope ( Scope scope , string type , string path ) {
86- scope .getLocation ( ) .getFile ( ) instanceof RelevantFile and
87- scope .isPublic ( ) and // only public methods are modeled
80+ scope instanceof Endpoint
8881 computeScopePath ( scope ) =
8982 type .replaceAll ( "!" , "" ) + "." +
9083 path .replaceAll ( "Member[" , "" ) .replaceAll ( "]" , "" ) .replaceAll ( "Instance." , "" ) +
0 commit comments