dhall-lsp-server-1.1.1: Language Server Protocol (LSP) server for Dhall
Safe HaskellNone
LanguageHaskell2010

Dhall.LSP.Backend.Diagnostics

Synopsis

Documentation

data DhallError Source #

A Dhall error. Covers parsing, resolving of imports, typechecking and normalisation.

diagnose :: DhallError -> [Diagnosis] Source #

Give a short diagnosis for a given error that can be shown to the end user.

data Diagnosis Source #

A diagnosis, optionally tagged with a source code range.

Constructors

Diagnosis 

Fields

explain :: DhallError -> Maybe Diagnosis Source #

Give a detailed explanation for the given error; if no detailed explanation is available return Nothing instead.

embedsWithRanges :: Expr Src a -> [(Range, a)] Source #

Collect all Embed constructors (i.e. imports if the expression has type `Expr Src Import`) wrapped in a Note constructor and return them together with their associated range in the source code.

type Position = (Int, Int) Source #

A (line, col) pair representing a position in a source file; 0-based.

data Range Source #

A source code range.

Constructors

Range 

Fields

rangeFromDhall :: Src -> Range Source #

Convert a source range from Dhalls Src format. The returned range is "tight", that is, does not contain any trailing whitespace.

subtractPosition :: Position -> Position -> Position Source #

addRelativePosition pos (subtractPosition pos pos') == pos'