dhall-lsp-server-1.0.1: Language Server Protocol (LSP) server for Dhall

Safe HaskellNone
LanguageHaskell2010

Dhall.LSP.Backend.Typing

Synopsis

Documentation

annotateLet :: Position -> WellTyped -> Either String (Src, Text) Source #

Given a well-typed expression and a position find the let binder at that position (if there is one) and return a textual update to the source code that inserts the type annotation (or replaces the existing one). If something goes wrong returns a textual error message.

exprAt :: Position -> Expr Src a -> Maybe (Expr Src a) Source #

Find the smallest Note-wrapped expression at the given position.

srcAt :: Position -> Expr Src a -> Maybe Src Source #

Find the smallest Src annotation containing the given position.

typeAt :: Position -> WellTyped -> Either String (Maybe Src, Expr Src X) Source #

Find the type of the subexpression at the given position. Assumes that the input expression is well-typed. Also returns the Src descriptor containing that subexpression if possible.