haskell-tools-daemon-1.1.1.0: Background process for Haskell-tools that editors can connect to.

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.Tools.Daemon.Protocol

Description

This module declares the messages that can be sent from the client to the daemon engine and from the engine to the client.

Synopsis

Documentation

type FileDiff = [(Int, Int, String)] Source #

data UndoRefactor Source #

Instances
Show UndoRefactor Source # 
Instance details

Defined in Language.Haskell.Tools.Daemon.Protocol

Generic UndoRefactor Source # 
Instance details

Defined in Language.Haskell.Tools.Daemon.Protocol

Associated Types

type Rep UndoRefactor :: Type -> Type #

NFData UndoRefactor Source # 
Instance details

Defined in Language.Haskell.Tools.Daemon.Protocol

Methods

rnf :: UndoRefactor -> () #

ToJSON UndoRefactor Source # 
Instance details

Defined in Language.Haskell.Tools.Daemon.Protocol

Methods

toJSON :: UndoRefactor -> Value

toEncoding :: UndoRefactor -> Encoding

toJSONList :: [UndoRefactor] -> Value

toEncodingList :: [UndoRefactor] -> Encoding

type Rep UndoRefactor Source # 
Instance details

Defined in Language.Haskell.Tools.Daemon.Protocol

type Rep UndoRefactor = D1 (MetaData "UndoRefactor" "Language.Haskell.Tools.Daemon.Protocol" "haskell-tools-daemon-1.1.1.0-Eiua9vsHGthI15B7hKxUY5" False) (C1 (MetaCons "RemoveAdded" PrefixI True) (S1 (MetaSel (Just "undoRemovePath") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FilePath)) :+: (C1 (MetaCons "RestoreRemoved" PrefixI True) (S1 (MetaSel (Just "undoRestorePath") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FilePath) :*: S1 (MetaSel (Just "undoRestoreContents") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String)) :+: C1 (MetaCons "UndoChanges" PrefixI True) (S1 (MetaSel (Just "undoChangedPath") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FilePath) :*: S1 (MetaSel (Just "undoDiff") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FileDiff))))

data ResponseMsg Source #

The possible responses that the server can give.

Constructors

KeepAliveResponse

A response to KeepAlive

HandshakeResponse

Tells the version of the server.

Fields

ErrorMessage

An error message marking internal problems or user mistakes. TODO: separate internal problems and user mistakes.

Fields

CompilationProblem

A response that tells there are errors in the source code given.

Fields

DiffInfo

Information about changes that would be caused by the refactoring.

Fields

LoadingModules

The traversal of the project is done, now the engine is loading the given modules.

Fields

LoadedModule

The engine has loaded the given module.

QueryResult

The result of querying the program representation.

Fields

UnusedFlags

Returns the flags that are not used by the engine.

Fields

Disconnected

The engine has closed the connection.

Instances
Show ResponseMsg Source # 
Instance details

Defined in Language.Haskell.Tools.Daemon.Protocol

Generic ResponseMsg Source # 
Instance details

Defined in Language.Haskell.Tools.Daemon.Protocol

Associated Types

type Rep ResponseMsg :: Type -> Type #

ToJSON ResponseMsg Source # 
Instance details

Defined in Language.Haskell.Tools.Daemon.Protocol

Methods

toJSON :: ResponseMsg -> Value

toEncoding :: ResponseMsg -> Encoding

toJSONList :: [ResponseMsg] -> Value

toEncodingList :: [ResponseMsg] -> Encoding

type Rep ResponseMsg Source # 
Instance details

Defined in Language.Haskell.Tools.Daemon.Protocol

type Rep ResponseMsg = D1 (MetaData "ResponseMsg" "Language.Haskell.Tools.Daemon.Protocol" "haskell-tools-daemon-1.1.1.0-Eiua9vsHGthI15B7hKxUY5" False) (((C1 (MetaCons "KeepAliveResponse" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "HandshakeResponse" PrefixI True) (S1 (MetaSel (Just "serverVersion") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Int]))) :+: (C1 (MetaCons "ErrorMessage" PrefixI True) (S1 (MetaSel (Just "errorMsg") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String)) :+: (C1 (MetaCons "CompilationProblem" PrefixI True) (S1 (MetaSel (Just "markers") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Marker]) :*: S1 (MetaSel (Just "errorHints") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String])) :+: C1 (MetaCons "DiffInfo" PrefixI True) (S1 (MetaSel (Just "diffInfo") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String))))) :+: ((C1 (MetaCons "LoadingModules" PrefixI True) (S1 (MetaSel (Just "modulesToLoad") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [FilePath])) :+: C1 (MetaCons "LoadedModule" PrefixI True) (S1 (MetaSel (Just "loadedModulePath") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FilePath) :*: S1 (MetaSel (Just "loadedModuleName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String))) :+: (C1 (MetaCons "QueryResult" PrefixI True) (S1 (MetaSel (Just "queryName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String) :*: (S1 (MetaSel (Just "queryType") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String) :*: S1 (MetaSel (Just "queryResult") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Value))) :+: (C1 (MetaCons "UnusedFlags" PrefixI True) (S1 (MetaSel (Just "unusedFlags") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String])) :+: C1 (MetaCons "Disconnected" PrefixI False) (U1 :: Type -> Type)))))

data ClientMessage Source #

The messages expected from the client.

Constructors

KeepAlive

A simple ping message to check that the server is running.

Reset

A message that instructs the server to reset its internal state and re-load loaded packages.

Handshake

Tells the client version and asks the servers version.

Fields

SetPackageDB

Sets the package database for the engine to use.

Fields

AddPackages

Registers packages to the engine. They will be subject to subsequent refactorings. Will cause the packages to be loaded, resulting in LoadingModules, LoadedModule or CompilationProblem responses.

Fields

RemovePackages

Deregisters the given packages from the engine. They will not be subjects of further refactorings.

Fields

SetWorkingDir

Sets the working directory for the compilation. Important when compiling code that loads resources based on relative pathes.

SetGHCFlags

Sets the compilation flags. The unused flags are returned via the UnusedFlags response.

Fields

PerformRefactoring

Orders the engine to perform the refactoring on the module given with the selection and details. Successful refactorings will cause re-loading of modules. If shutdownAfter or diffMode is not set, after the refactoring, modules are re-loaded, LoadingModules, LoadedModule responses are sent.

Fields

PerformQuery

Orders the engine to perform a query on the module given with the selection and details.

Fields

UndoLast

Asks the daemon to undo the last refactoring.

Disconnect

Stops the engine. It replies with Disconnected.

ReLoad

Instructs the engine to re-load a changed module. LoadingModules, LoadedModule responses may be sent.

Stop

Stops the server. OBSOLATE

Instances
Show ClientMessage Source # 
Instance details

Defined in Language.Haskell.Tools.Daemon.Protocol

Generic ClientMessage Source # 
Instance details

Defined in Language.Haskell.Tools.Daemon.Protocol

Associated Types

type Rep ClientMessage :: Type -> Type #

FromJSON ClientMessage Source # 
Instance details

Defined in Language.Haskell.Tools.Daemon.Protocol

Methods

parseJSON :: Value -> Parser ClientMessage

parseJSONList :: Value -> Parser [ClientMessage]

type Rep ClientMessage Source # 
Instance details

Defined in Language.Haskell.Tools.Daemon.Protocol

type Rep ClientMessage = D1 (MetaData "ClientMessage" "Language.Haskell.Tools.Daemon.Protocol" "haskell-tools-daemon-1.1.1.0-Eiua9vsHGthI15B7hKxUY5" False) (((C1 (MetaCons "KeepAlive" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "Reset" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Handshake" PrefixI True) (S1 (MetaSel (Just "clientVersion") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Int])))) :+: ((C1 (MetaCons "SetPackageDB" PrefixI True) (S1 (MetaSel (Just "pkgDB") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 PackageDB)) :+: C1 (MetaCons "AddPackages" PrefixI True) (S1 (MetaSel (Just "addedPathes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [FilePath]))) :+: (C1 (MetaCons "RemovePackages" PrefixI True) (S1 (MetaSel (Just "removedPathes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [FilePath])) :+: C1 (MetaCons "SetWorkingDir" PrefixI True) (S1 (MetaSel (Just "newWorkingDir") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FilePath))))) :+: ((C1 (MetaCons "SetGHCFlags" PrefixI True) (S1 (MetaSel (Just "ghcFlags") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String])) :+: (C1 (MetaCons "PerformRefactoring" PrefixI True) ((S1 (MetaSel (Just "refactoring") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String) :*: (S1 (MetaSel (Just "modulePath") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FilePath) :*: S1 (MetaSel (Just "editorSelection") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String))) :*: (S1 (MetaSel (Just "details") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String]) :*: (S1 (MetaSel (Just "shutdownAfter") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool) :*: S1 (MetaSel (Just "diffMode") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)))) :+: C1 (MetaCons "PerformQuery" PrefixI True) ((S1 (MetaSel (Just "query") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String) :*: S1 (MetaSel (Just "modulePath") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FilePath)) :*: (S1 (MetaSel (Just "editorSelection") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String) :*: (S1 (MetaSel (Just "details") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String]) :*: S1 (MetaSel (Just "shutdownAfter") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)))))) :+: ((C1 (MetaCons "UndoLast" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Disconnect" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "ReLoad" PrefixI True) (S1 (MetaSel (Just "addedModules") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [FilePath]) :*: (S1 (MetaSel (Just "changedModules") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [FilePath]) :*: S1 (MetaSel (Just "removedModules") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [FilePath]))) :+: C1 (MetaCons "Stop" PrefixI False) (U1 :: Type -> Type)))))

data Marker #

Constructors

Marker 
Instances
Eq Marker 
Instance details

Defined in Language.Haskell.Tools.Refactor.Querying

Methods

(==) :: Marker -> Marker -> Bool #

(/=) :: Marker -> Marker -> Bool #

Show Marker 
Instance details

Defined in Language.Haskell.Tools.Refactor.Querying

Generic Marker 
Instance details

Defined in Language.Haskell.Tools.Refactor.Querying

Associated Types

type Rep Marker :: Type -> Type #

Methods

from :: Marker -> Rep Marker x #

to :: Rep Marker x -> Marker #

ToJSON Marker 
Instance details

Defined in Language.Haskell.Tools.Refactor.Querying

Methods

toJSON :: Marker -> Value

toEncoding :: Marker -> Encoding

toJSONList :: [Marker] -> Value

toEncodingList :: [Marker] -> Encoding

type Rep Marker 
Instance details

Defined in Language.Haskell.Tools.Refactor.Querying

type Rep Marker = D1 (MetaData "Marker" "Language.Haskell.Tools.Refactor.Querying" "haskell-tools-refactor-1.1.1.0-4hDiIQBBrTRH5RcrTGrIEl" False) (C1 (MetaCons "Marker" PrefixI True) (S1 (MetaSel (Just "location") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 SrcSpan) :*: (S1 (MetaSel (Just "severity") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Severity) :*: S1 (MetaSel (Just "message") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String))))

data Severity #

Constructors

Error 
Warning 
Info 
Instances
Eq Severity 
Instance details

Defined in Language.Haskell.Tools.Refactor.Querying

Show Severity 
Instance details

Defined in Language.Haskell.Tools.Refactor.Querying

Generic Severity 
Instance details

Defined in Language.Haskell.Tools.Refactor.Querying

Associated Types

type Rep Severity :: Type -> Type #

Methods

from :: Severity -> Rep Severity x #

to :: Rep Severity x -> Severity #

ToJSON Severity 
Instance details

Defined in Language.Haskell.Tools.Refactor.Querying

Methods

toJSON :: Severity -> Value

toEncoding :: Severity -> Encoding

toJSONList :: [Severity] -> Value

toEncodingList :: [Severity] -> Encoding

type Rep Severity 
Instance details

Defined in Language.Haskell.Tools.Refactor.Querying

type Rep Severity = D1 (MetaData "Severity" "Language.Haskell.Tools.Refactor.Querying" "haskell-tools-refactor-1.1.1.0-4hDiIQBBrTRH5RcrTGrIEl" False) (C1 (MetaCons "Error" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "Warning" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Info" PrefixI False) (U1 :: Type -> Type)))