Skip to content

Commit e54e371

Browse files
Catherine Gasniermeta-codesync[bot]
authored andcommitted
new helper predicate RangeSpanContains
Summary: This is useful for things like call hierarchy (who calls who) Differential Revision: D88166192 fbshipit-source-id: bb3f57f3d439fe8a46c40bbd86f07a0391ce9e3f
1 parent f7363d6 commit e54e371

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

glean/schema/source/lsif.types.angle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,18 @@ type RangeSpan =
5757
columnEnd : nat,
5858
}
5959

60+
predicate RangeSpanContains:
61+
{
62+
inner: RangeSpan,
63+
outer: RangeSpan,
64+
} { I, O } where
65+
{LBI, CBI, LEI, CEI} = I;
66+
{LBO, CBO, LEO, CEO} = O;
67+
LBO <= LBI;
68+
LEI <= LEO;
69+
(LBO < LBI | CBO <= CBI);
70+
(LEI < LEO | CEI <= CEO)
71+
6072
# convenience to convert between lsif.RangeSpan and src.Range
6173
# These are both 1-indexed range types, but lsif doesn't have a File
6274
predicate ToSrcRange:

0 commit comments

Comments
 (0)