futhark-0.25.25: An optimising compiler for a functional, array-oriented language.
Safe HaskellSafe-Inferred
LanguageGHC2021

Futhark.LSP.PositionMapping

Description

Provide mapping between position in stale content and current.

Synopsis

Documentation

mappingFromDiff :: [Text] -> [Text] -> PositionMapping Source #

Compute PositionMapping using the diff between two texts.

data PositionMapping Source #

A mapping between current file content and the stale (last successful compiled) file content. Currently, only supports entire line mapping, more detailed mapping might be achieved via referring to haskell-language-server@efb4b94

Instances

Instances details
Show PositionMapping Source # 
Instance details

Defined in Futhark.LSP.PositionMapping

toStalePos :: Maybe PositionMapping -> Pos -> Maybe Pos Source #

Transform current Pos to the stale pos for query Note: line and col in Pos is larger by one

toCurrentLoc :: Maybe PositionMapping -> Loc -> Maybe Loc Source #

Transform stale Loc gotten from stale AST to current Loc.

data StaleFile Source #

Stale pretty document stored in state.

Constructors

StaleFile 

Fields

  • staleContent :: VirtualFile

    The last successfully compiled file content. Using VirtualFile for convenience, we can use anything with {version, content}

  • staleMapping :: Maybe PositionMapping

    PositionMapping between current and stale file content. Nothing if last type-check is successful.

Instances

Instances details
Show StaleFile Source # 
Instance details

Defined in Futhark.LSP.PositionMapping