1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 09:15:01 +03:00

📝 sourceSpanToRange.

This commit is contained in:
Rob Rix 2016-09-13 12:00:41 -04:00
parent b3248a4a95
commit 7dc8393953

View File

@ -91,6 +91,7 @@ actualLineRanges :: Range -> Source Char -> [Range]
actualLineRanges range = drop 1 . scanl toRange (Range (start range) (start range)) . actualLines . slice range
where toRange previous string = Range (end previous) $ end previous + length string
-- | Compute the character range corresponding to a given SourceSpan within a Source.
sourceSpanToRange :: Source Char -> SourceSpan -> Range
sourceSpanToRange _ _ = Range 0 0