ghcide-2.9.0.0: The core of an IDE
Safe HaskellSafe-Inferred
LanguageGHC2021

Development.IDE.Core.PositionMapping

Synopsis

Documentation

data PositionResult a Source #

Either an exact position, or the range of text that was substituted

Constructors

PositionRange

Fields need to be non-strict otherwise bind is exponential

PositionExact !a 

Instances

Instances details
Applicative PositionResult Source # 
Instance details

Defined in Development.IDE.Core.PositionMapping

Functor PositionResult Source # 
Instance details

Defined in Development.IDE.Core.PositionMapping

Methods

fmap :: (a -> b) -> PositionResult a -> PositionResult b #

(<$) :: a -> PositionResult b -> PositionResult a #

Monad PositionResult Source # 
Instance details

Defined in Development.IDE.Core.PositionMapping

Show a => Show (PositionResult a) Source # 
Instance details

Defined in Development.IDE.Core.PositionMapping

Eq a => Eq (PositionResult a) Source # 
Instance details

Defined in Development.IDE.Core.PositionMapping

Ord a => Ord (PositionResult a) Source # 
Instance details

Defined in Development.IDE.Core.PositionMapping

addOldDelta Source #

Arguments

:: PositionDelta

delta from version k - 1 to version k

-> PositionMapping

The input mapping is from version k to version n

-> PositionMapping

The output mapping is from version k - 1 to version n

addOldDelta Add a old delta onto a Mapping k n to make a Mapping (k - 1) n

composeDelta :: PositionDelta -> PositionDelta -> PositionDelta Source #

Compose two position mappings. Composes in the same way as function composition (ie the second argument is applied to the position first).

mkDelta :: [TextDocumentContentChangeEvent] -> PositionDelta Source #

Convert a set of changes into a delta from k to k + 1

applyChange :: PositionDelta -> TextDocumentContentChangeEvent -> PositionDelta Source #