From 61e29e8fdbace35f38b7f3c3dad1257e2e3fac8c Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Fri, 19 May 2017 11:20:52 -0400 Subject: [PATCH] Compute the line ranges within the range. --- src/Source.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Source.hs b/src/Source.hs index 831bdf0c8..a2ea56b7c 100644 --- a/src/Source.hs +++ b/src/Source.hs @@ -121,7 +121,7 @@ rangeToSourceSpan :: Source -> Range -> SourceSpan rangeToSourceSpan source range = SourceSpan startPos endPos where startPos = maybe (SourcePos 1 1) (toStartPos 1) (head lineRanges) endPos = toEndPos (Prologue.length lineRanges) (fromMaybe (Range 0 0) (snd <$> unsnoc lineRanges)) - lineRanges = actualLineRanges (slice range source) + lineRanges = actualLineRangesWithin range source toStartPos line range = SourcePos line (succ (start range)) toEndPos line range = SourcePos line (succ (end range))