@@ -346,7 +346,7 @@ private int getImplementationSize(ValueOrRefType t, File f) {
346346 result = getImplementationSize1 ( t , f )
347347}
348348
349- private cached module Cached {
349+ cached module ExprOrStmtParentCached {
350350 cached
351351 ControlFlowElement getTopLevelChild ( ExprOrStmtParent p , int i ) {
352352 result = p .( MultiImplementationsParent ) .getBestChild ( i )
@@ -363,7 +363,7 @@ private cached module Cached {
363363 * in `f`.
364364 */
365365 cached
366- predicate mustHaveLocationInFileCached ( Declaration d , File f ) {
366+ predicate mustHaveLocationInFile ( Declaration d , File f ) {
367367 exists ( MultiImplementationsParent p , ValueOrRefType t |
368368 t = getTopLevelDeclaringType ( p ) and
369369 f = p .getBestFile ( ) |
@@ -381,7 +381,7 @@ private cached module Cached {
381381 * locations, choose only one.
382382 */
383383 cached
384- Location bestLocationCached ( Element e ) {
384+ Location bestLocation ( Element e ) {
385385 result = e .getALocation ( ) .( SourceLocation ) and
386386 ( mustHaveLocationInFile ( e , _) implies mustHaveLocationInFile ( e , result .getFile ( ) ) )
387387 or
@@ -391,8 +391,17 @@ private cached module Cached {
391391 result = min ( Location l | l = e .getALocation ( ) | l order by l .getFile ( ) .toString ( ) )
392392 )
393393 }
394- }
395- private import Cached
396394
397- predicate mustHaveLocationInFile = mustHaveLocationInFileCached / 2 ;
398- predicate bestLocation = bestLocationCached / 1 ;
395+ cached
396+ string getURL ( Element e ) {
397+ exists ( Location l , string path , int a , int b , int c , int d |
398+ l = bestLocation ( e ) |
399+ l .hasLocationInfo ( path , a , b , c , d ) and
400+ toUrl ( path , a , b , c , d , result )
401+ )
402+ or
403+ not exists ( bestLocation ( e ) ) and
404+ result = ""
405+ }
406+ }
407+ private import ExprOrStmtParentCached
0 commit comments