Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype PositionMapping = PositionMapping PositionDelta
- data PositionResult a
- = PositionRange {
- unsafeLowerRange :: a
- unsafeUpperRange :: a
- | PositionExact !a
- = PositionRange {
- lowerRange :: PositionResult a -> a
- upperRange :: PositionResult a -> a
- positionResultToMaybe :: PositionResult a -> Maybe a
- fromCurrentPosition :: PositionMapping -> Position -> Maybe Position
- toCurrentPosition :: PositionMapping -> Position -> Maybe Position
- data PositionDelta = PositionDelta {
- toDelta :: !(Position -> PositionResult Position)
- fromDelta :: !(Position -> PositionResult Position)
- addDelta :: PositionDelta -> PositionMapping -> PositionMapping
- mkDelta :: [TextDocumentContentChangeEvent] -> PositionDelta
- toCurrentRange :: PositionMapping -> Range -> Maybe Range
- fromCurrentRange :: PositionMapping -> Range -> Maybe Range
- applyChange :: PositionDelta -> TextDocumentContentChangeEvent -> PositionDelta
- zeroMapping :: PositionMapping
- toCurrent :: Range -> Text -> Position -> PositionResult Position
- fromCurrent :: Range -> Text -> Position -> PositionResult Position
Documentation
data PositionResult a Source #
Either an exact position, or the range of text that was substituted
PositionRange | Fields need to be non-strict otherwise bind is exponential |
| |
PositionExact !a |
Instances
lowerRange :: PositionResult a -> a Source #
upperRange :: PositionResult a -> a Source #
positionResultToMaybe :: PositionResult a -> Maybe a Source #
toCurrentPosition :: PositionMapping -> Position -> Maybe Position Source #
data PositionDelta Source #
PositionDelta | |
|
addDelta :: PositionDelta -> PositionMapping -> PositionMapping Source #
Add a new delta onto a Mapping k n to make a Mapping (k - 1) n
mkDelta :: [TextDocumentContentChangeEvent] -> PositionDelta Source #
Convert a set of changes into a delta from k to k + 1
toCurrentRange :: PositionMapping -> Range -> Maybe Range Source #
fromCurrentRange :: PositionMapping -> Range -> Maybe Range Source #
fromCurrent :: Range -> Text -> Position -> PositionResult Position Source #