ide-backend-common-0.9.1: Shared library used be ide-backend and ide-backend-server

Safe HaskellNone
LanguageHaskell2010

IdeSession.Types.Public

Contents

Description

The public types

Synopsis

Types

data IdNameSpace Source

Identifiers in Haskell are drawn from a number of different name spaces

Constructors

VarName

Variables, including real data constructors

DataName

Source data constructors

TvName

Type variables

TcClsName

Type constructors and classes

type Type = Text Source

For now we represent types in pretty-printed form

type Name = Text Source

Variable name

data IdInfo Source

Information about identifiers

Constructors

IdInfo 

Fields

idProp :: !IdProp
 
idScope :: !IdScope
 

data IdProp Source

Identifier info that is independent of the usage site

Constructors

IdProp 

Fields

idName :: !Name

The base name of the identifer at this location. Module prefix is not included.

idSpace :: !IdNameSpace

Namespace this identifier is drawn from

idType :: !(Maybe Type)

The type We don't always know this; in particular, we don't know kinds because the type checker does not give us LSigs for top-level annotations)

idDefinedIn :: !ModuleId

Module the identifier was defined in

idDefSpan :: !EitherSpan

Where in the module was it defined (not always known)

idHomeModule :: !(Maybe ModuleId)

Haddock home module

data IdScope Source

Constructors

Binder

This is a binding occurrence (f x = .., x -> .., etc.)

Local

Defined within this module

Imported

Imported from a different module

Fields

idImportedFrom :: !ModuleId
 
idImportSpan :: !EitherSpan
 
idImportQual :: !Text

Qualifier used for the import

IMPORTED AS                       idImportQual
import Data.List                  ""
import qualified Data.List        "Data.List."
import qualified Data.List as L   "L."
WiredIn

Wired into the compiler ((), True, etc.)

data SourceError Source

An error or warning in a source module.

Most errors are associated with a span of text, but some have only a location point.

Constructors

SourceError 

type ModuleName = Text Source

data PackageId Source

A package ID in ide-backend consists of a human-readable package name and version (what Cabal calls a source ID) along with ghc's internal package key (primarily for internal use).

Constructors

PackageId 

Fields

packageName :: !Text
 
packageVersion :: !(Maybe Text)
 
packageKey :: !Text
 

data Import Source

Constructors

Import 

Fields

importModule :: !ModuleId
 
importPackage :: !(Maybe Text)

Used only for ghc's PackageImports extension

importQualified :: !Bool
 
importImplicit :: !Bool
 
importAs :: !(Maybe ModuleName)
 
importEntities :: !ImportEntities
 

data SpanInfo Source

Returned then the IDE asks "what's at this particular location?"

Constructors

SpanId IdInfo

Identifier

SpanQQ IdInfo

Quasi-quote. The IdInfo field gives the quasi-quoter

data RunBufferMode Source

Buffer modes for running code

Note that NoBuffering means that something like putStrLn will do a syscall per character, and each of these characters will be read and sent back to the client. This results in a large overhead.

When using LineBuffering or BlockBuffering, runWait will not report any output from the snippet until it outputs a linebreak/fills the buffer, respectively (or does an explicit flush). However, you can specify a timeout in addition to the buffering mode; if you set this to Just n, the buffer will be flushed every n microseconds.

NOTE: This is duplicated in the IdeBackendRTS (defined in IdeSession)

data RunResult Source

The outcome of running code

Constructors

RunOk

The code terminated okay

RunProgException String

The code threw an exception

RunGhcException String

GHC itself threw an exception when we tried to run the code

RunForceCancelled

The session was restarted

RunBreak

Execution was paused because of a breakpoint

data BreakInfo Source

Information about a triggered breakpoint

Constructors

BreakInfo 

Fields

breakInfoModule :: ModuleName

Module containing the breakpoint

breakInfoSpan :: SourceSpan

Location of the breakpoint

breakInfoResultType :: Type

Type of the result

breakInfoVariableEnv :: VariableEnv

Local variables and their values

type Value = Text Source

We present values only in pretty-printed form

type VariableEnv = [(Name, Type, Value)] Source

Variables during execution (in debugging mode)

Util

idInfoQN :: IdInfo -> String Source

Construct qualified name following Haskell's scoping rules

haddockLink :: IdProp -> IdScope -> String Source

Show approximately a haddock link (without haddock root) for an id. This is an illustration and a test of the id info, but under ideal conditions could perhaps serve to link to documentation without going via Hoogle.