mirror of
https://github.com/github/semantic.git
synced 2024-12-21 05:41:54 +03:00
Compute the line ranges within the range.
This commit is contained in:
parent
71e3c1d482
commit
61e29e8fdb
@ -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))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user