Skip to content

Commit 2c4100d

Browse files
committed
ghcide: Spans: AtPoint: pointCommand: form local function
1 parent c854075 commit 2c4100d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ghcide/src/Development/IDE/Spans/AtPoint.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,9 @@ pointCommand :: HieASTs t -- ^ Get AST
399399
-> (HieAST t -> a) -- ^ extact data with a getter
400400
-> [a] -- ^ all data recieved
401401
pointCommand hf pos getter =
402-
catMaybes $ M.elems $ flip M.mapWithKey (getAsts hf) $ \fs ast ->
402+
catMaybes $ M.elems $ M.mapWithKey findInfo (getAsts hf)
403+
where
404+
findInfo fs ast =
403405
-- Since GHC 9.2:
404406
-- getAsts :: Map HiePath (HieAst a)
405407
-- type HiePath = LexialFastString
@@ -412,7 +414,6 @@ pointCommand hf pos getter =
412414
-- backwards compatibility.
413415
let smallestRange = selectSmallestContaining (sp $ coerce fs) ast in
414416
fmap getter smallestRange
415-
where
416417
sloc fs = mkRealSrcLoc fs (line+1) (cha+1)
417418
sp fs = mkRealSrcSpan (sloc fs) (sloc fs)
418419
line = _line pos

0 commit comments

Comments
 (0)