File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
hls-plugin-api/src/Ide/Plugin Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ module Ide.Plugin.RangeMap
13
13
fromList ,
14
14
fromList' ,
15
15
filterByRange ,
16
+ flippedFilterByRange ,
16
17
) where
17
18
18
19
import Development.IDE.Graph.Classes (NFData )
@@ -67,6 +68,14 @@ filterByRange range = map snd . IM.dominators (rangeToInterval range) . unRangeM
67
68
filterByRange range = map snd . filter (isSubrangeOf range . fst ) . unRangeMap
68
69
#endif
69
70
71
+ -- | Flipped filter a 'RangeMap' by a given 'Range'.
72
+ flippedFilterByRange :: Range -> RangeMap a -> [a ]
73
+ #ifdef USE_FINGERTREE
74
+ flippedFilterByRange range = map snd . IM. intersections (rangeToInterval range) . unRangeMap
75
+ #else
76
+ flippedFilterByRange range = map snd . filter (flip isSubrangeOf range . fst ) . unRangeMap
77
+ #endif
78
+
70
79
#ifdef USE_FINGERTREE
71
80
-- NOTE(ozkutuk): In itself, this conversion is wrong. As Michael put it:
72
81
-- "LSP Ranges have exclusive upper bounds, whereas the intervals here are
You can’t perform that action at this time.
0 commit comments