Skip to content

Commit 4faf1d0

Browse files
committed
rename flippedFilterByRange to elementsInRange
1 parent a0a35b7 commit 4faf1d0

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

hls-plugin-api/src/Ide/Plugin/RangeMap.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module Ide.Plugin.RangeMap
1313
fromList,
1414
fromList',
1515
filterByRange,
16-
flippedFilterByRange,
16+
elementsInRange,
1717
) where
1818

1919
import Development.IDE.Graph.Classes (NFData)
@@ -68,12 +68,12 @@ filterByRange range = map snd . IM.dominators (rangeToInterval range) . unRangeM
6868
filterByRange range = map snd . filter (isSubrangeOf range . fst) . unRangeMap
6969
#endif
7070

71-
-- | Flipped filter a 'RangeMap' by a given 'Range'.
72-
flippedFilterByRange :: Range -> RangeMap a -> [a]
71+
-- | Extracts all elements from a 'RangeMap' that fall within a given 'Range'.
72+
elementsInRange :: Range -> RangeMap a -> [a]
7373
#ifdef USE_FINGERTREE
74-
flippedFilterByRange range = map snd . IM.intersections (rangeToInterval range) . unRangeMap
74+
elementsInRange range = map snd . IM.intersections (rangeToInterval range) . unRangeMap
7575
#else
76-
flippedFilterByRange range = map snd . filter (flip isSubrangeOf range . fst) . unRangeMap
76+
elementsInRange range = map snd . filter (flip isSubrangeOf range . fst) . unRangeMap
7777
#endif
7878

7979
#ifdef USE_FINGERTREE

plugins/hls-explicit-record-fields-plugin/src/Ide/Plugin/ExplicitFields.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ inlayHintProvider _ state pId InlayHintParams {_textDocument = TextDocumentIdent
183183
let -- Get all records with dotdot in current nfp
184184
records = [ record
185185
| Just range <- [toCurrentRange pm visibleRange]
186-
, uid <- RangeMap.flippedFilterByRange range crCodeActions
186+
, uid <- RangeMap.elementsInRange range crCodeActions
187187
, Just record <- [IntMap.lookup uid crCodeActionResolve] ]
188188
-- Get the definition of each dotdot of record
189189
locations = [ getDefinition nfp pos

0 commit comments

Comments
 (0)