@@ -360,11 +360,13 @@ class CrateItemNode extends ItemNode instanceof Crate {
360
360
361
361
override predicate providesCanonicalPathPrefixFor ( Crate c , ItemNode child ) {
362
362
this .hasCanonicalPath ( c ) and
363
- exists ( ModuleLikeNode m | m = this .getModuleNode ( ) |
364
- child = m
365
- or
366
- child .getImmediateParent ( ) = m .( SourceFile ) and
363
+ exists ( ModuleLikeNode m |
364
+ child .getImmediateParent ( ) = m and
367
365
not m = child .( SourceFileItemNode ) .getSuper ( )
366
+ |
367
+ m = super .getModule ( ) // the special `crate` root module inserted by the extractor
368
+ or
369
+ m = super .getSourceFile ( )
368
370
)
369
371
}
370
372
@@ -648,6 +650,16 @@ private class MacroCallItemNode extends AssocItemNode instanceof MacroCall {
648
650
649
651
override Visibility getVisibility ( ) { none ( ) }
650
652
653
+ override predicate providesCanonicalPathPrefixFor ( Crate c , ItemNode child ) {
654
+ any ( ItemNode parent ) .providesCanonicalPathPrefixFor ( c , this ) and
655
+ child .getImmediateParent ( ) = this
656
+ }
657
+
658
+ override string getCanonicalPathPrefixFor ( Crate c , ItemNode child ) {
659
+ result = this .getCanonicalPathPrefix ( c ) and
660
+ this .providesCanonicalPathPrefixFor ( c , child )
661
+ }
662
+
651
663
override predicate hasCanonicalPath ( Crate c ) { none ( ) }
652
664
653
665
override string getCanonicalPath ( Crate c ) { none ( ) }
@@ -1413,8 +1425,8 @@ private module Debug {
1413
1425
private Locatable getRelevantLocatable ( ) {
1414
1426
exists ( string filepath , int startline , int startcolumn , int endline , int endcolumn |
1415
1427
result .getLocation ( ) .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn ) and
1416
- filepath .matches ( "%/test_logging .rs" ) and
1417
- startline = 163
1428
+ filepath .matches ( "%/clean/types .rs" ) and
1429
+ startline = [ 5 , 350 ]
1418
1430
)
1419
1431
}
1420
1432
@@ -1450,4 +1462,14 @@ private module Debug {
1450
1462
m = getRelevantLocatable ( ) and
1451
1463
fileImport ( m , f )
1452
1464
}
1465
+
1466
+ predicate debugPreludeEdge ( SourceFile f , string name , ItemNode i ) {
1467
+ preludeEdge ( f , name , i ) and
1468
+ f = getRelevantLocatable ( )
1469
+ }
1470
+
1471
+ string debugGetCanonicalPath ( ItemNode i , Crate c ) {
1472
+ result = i .getCanonicalPath ( c ) and
1473
+ i = getRelevantLocatable ( )
1474
+ }
1453
1475
}
0 commit comments