ghcide-0.0.6: The core of an IDE

Safe HaskellNone
LanguageHaskell2010

Development.IDE.Core.Shake

Description

A Shake implementation of the compiler service.

There are two primary locations where data lives, and both of these contain much the same data:

  • The Shake database (inside shakeDb) stores a map of shake keys to shake values. In our case, these are all of type Q to A. During a single run all the values in the Shake database are consistent so are used in conjunction with each other, e.g. in uses.
  • The Values type stores a map of keys to values. These values are always stored as real Haskell values, whereas Shake serialises all A values between runs. To deserialise a Shake value, we just consult Values.
Synopsis

Documentation

data IdeState Source #

A Shake database plus persistent store. Can be thought of as storing mappings from (FilePath, k) to RuleResult k.

type IdeRule k v = (RuleResult k ~ v, ShakeValue k, Show v, Typeable v, NFData v) Source #

type IdeResult v = ([FileDiagnostic], Maybe v) Source #

The result of an IDE operation. Warnings and errors are in the Diagnostic, and a value is in the Maybe. For operations that throw an error you expect a non-empty list of diagnostics, at least one of which is an error, and a Nothing. For operations that succeed you expect perhaps some warnings and a Just. For operations that depend on other failing operations you may get empty diagnostics and a Nothing, to indicate this phase throws no fresh errors but still failed.

A rule on a file should only return diagnostics for that given file. It should not propagate diagnostic errors through multiple phases.

data GetModificationTime Source #

Constructors

GetModificationTime 
Instances
Eq GetModificationTime Source # 
Instance details

Defined in Development.IDE.Core.Shake

Show GetModificationTime Source # 
Instance details

Defined in Development.IDE.Core.Shake

Generic GetModificationTime Source # 
Instance details

Defined in Development.IDE.Core.Shake

Associated Types

type Rep GetModificationTime :: Type -> Type #

Hashable GetModificationTime Source # 
Instance details

Defined in Development.IDE.Core.Shake

Binary GetModificationTime Source # 
Instance details

Defined in Development.IDE.Core.Shake

NFData GetModificationTime Source # 
Instance details

Defined in Development.IDE.Core.Shake

Methods

rnf :: GetModificationTime -> () #

type Rep GetModificationTime Source # 
Instance details

Defined in Development.IDE.Core.Shake

type Rep GetModificationTime = D1 (MetaData "GetModificationTime" "Development.IDE.Core.Shake" "ghcide-0.0.6-GENwzYdUusGKoTADOmllce" False) (C1 (MetaCons "GetModificationTime" PrefixI False) (U1 :: Type -> Type))
type RuleResult GetModificationTime Source #

Get the modification time of a file.

Instance details

Defined in Development.IDE.Core.Shake

shakeOpen Source #

Arguments

:: IO LspId 
-> (FromServerMessage -> IO ())

diagnostic handler

-> Logger 
-> Maybe FilePath 
-> IdeReportProgress 
-> ShakeOptions 
-> Rules () 
-> IO IdeState 

Open a IdeState, should be shut using shakeShut.

shakeRun :: IdeState -> [Action a] -> IO (IO [a]) Source #

Spawn immediately. If you are already inside a call to shakeRun that will be aborted with an exception.

useNoFile :: IdeRule k v => k -> Action (Maybe v) Source #

uses :: IdeRule k v => k -> [NormalizedFilePath] -> Action [Maybe v] Source #

Return up2date results. Stale results will be ignored.

usesWithStale :: IdeRule k v => k -> [NormalizedFilePath] -> Action [Maybe (v, PositionMapping)] Source #

Return the last computed result which might be stale.

useNoFile_ :: IdeRule k v => k -> Action v Source #

uses_ :: IdeRule k v => k -> [NormalizedFilePath] -> Action [v] Source #

unsafeClearDiagnostics :: IdeState -> IO () Source #

FIXME: This function is temporary! Only required because the files of interest doesn't work

class Typeable a => IsIdeGlobal a Source #

Instances
IsIdeGlobal VFSHandle Source # 
Instance details

Defined in Development.IDE.Core.FileStore

garbageCollect :: (NormalizedFilePath -> Bool) -> Action () Source #

Clear the results for all files that do not match the given predicate.

data FileVersion Source #

We store the modification time as a ByteString since we need a ByteString anyway for Shake and we do not care about how times are represented.

Instances
Show FileVersion Source # 
Instance details

Defined in Development.IDE.Core.Shake

Generic FileVersion Source # 
Instance details

Defined in Development.IDE.Core.Shake

Associated Types

type Rep FileVersion :: Type -> Type #

NFData FileVersion Source # 
Instance details

Defined in Development.IDE.Core.Shake

Methods

rnf :: FileVersion -> () #

type Rep FileVersion Source # 
Instance details

Defined in Development.IDE.Core.Shake

type Rep FileVersion = D1 (MetaData "FileVersion" "Development.IDE.Core.Shake" "ghcide-0.0.6-GENwzYdUusGKoTADOmllce" False) (C1 (MetaCons "VFSVersion" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)) :+: C1 (MetaCons "ModificationTime" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ByteString)))

newtype Priority Source #

Constructors

Priority Double