Safe Haskell | None |
---|---|
Language | Haskell2010 |
Language.Haskell.Tools.Demo
Synopsis
- type ClientId = Int
- data RefactorSessionState = RefactorSessionState {
- _refSessMods :: Map (String, String, FilePath) UnnamedModule
- _actualMod :: Maybe (String, String, FilePath)
- _isDisconnecting :: Bool
- refSessMods :: Lens RefactorSessionState RefactorSessionState (Map (String, String, FilePath) UnnamedModule) (Map (String, String, FilePath) UnnamedModule)
- isDisconnecting :: Lens RefactorSessionState RefactorSessionState Bool Bool
- actualMod :: Lens RefactorSessionState RefactorSessionState (Maybe (String, String, FilePath)) (Maybe (String, String, FilePath))
- initSession :: RefactorSessionState
- runFromCLI :: IO ()
- runDemo :: [String] -> IO ()
- app :: MVar [Int] -> FilePath -> Application
- respondTo :: FilePath -> Int -> Session -> MVar RefactorSessionState -> (ByteString -> IO ()) -> ByteString -> IO ()
- updateClient :: FilePath -> ClientMessage -> StateT RefactorSessionState Ghc (Maybe ResponseMsg)
- reloadAllMods :: FilePath -> StateT RefactorSessionState Ghc ()
- createFileForModule :: FilePath -> String -> String -> IO ()
- removeDirectoryIfPresent :: FilePath -> IO ()
- moduleNameAndContent :: ((String, String, FilePath), mod) -> (SourceFileKey, mod)
- dataDirs :: FilePath -> FilePath
- userDir :: FilePath -> ClientId -> FilePath
- initGhcSession :: FilePath -> IO Session
- handleErrors :: FilePath -> ClientMessage -> (ResponseMsg -> IO ()) -> IO () -> IO ()
- logToFile :: FilePath -> String -> ClientMessage -> IO ()
- data ClientMessage
- = KeepAlive
- | InitialProject {
- initialModules :: [(String, String)]
- | PerformRefactoring {
- refactoring :: String
- moduleName :: String
- editorSelection :: String
- details :: [String]
- | ModuleChanged {
- moduleName :: String
- newContent :: String
- | ModuleDeleted {
- moduleName :: String
- | Disconnect
- data ResponseMsg
- = RefactorChanges {
- moduleChanges :: [(String, Maybe String)]
- | ASTViewContent {
- astContent :: String
- | ErrorMessage { }
- | CompilationProblem { }
- | Disconnected
- = RefactorChanges {
Documentation
data RefactorSessionState Source #
Constructors
RefactorSessionState | |
Fields
|
refSessMods :: Lens RefactorSessionState RefactorSessionState (Map (String, String, FilePath) UnnamedModule) (Map (String, String, FilePath) UnnamedModule) Source #
actualMod :: Lens RefactorSessionState RefactorSessionState (Maybe (String, String, FilePath)) (Maybe (String, String, FilePath)) Source #
runFromCLI :: IO () Source #
app :: MVar [Int] -> FilePath -> Application Source #
The application that is evoked for each incoming request
respondTo :: FilePath -> Int -> Session -> MVar RefactorSessionState -> (ByteString -> IO ()) -> ByteString -> IO () Source #
updateClient :: FilePath -> ClientMessage -> StateT RefactorSessionState Ghc (Maybe ResponseMsg) Source #
This function does the real job of acting upon client messages in a stateful environment of a client
reloadAllMods :: FilePath -> StateT RefactorSessionState Ghc () Source #
removeDirectoryIfPresent :: FilePath -> IO () Source #
handleErrors :: FilePath -> ClientMessage -> (ResponseMsg -> IO ()) -> IO () -> IO () Source #
data ClientMessage Source #
Constructors
KeepAlive | |
InitialProject | |
Fields
| |
PerformRefactoring | |
Fields
| |
ModuleChanged | |
Fields
| |
ModuleDeleted | |
Fields
| |
Disconnect |
Instances
data ResponseMsg Source #
Constructors
RefactorChanges | |
Fields
| |
ASTViewContent | |
Fields
| |
ErrorMessage | |
CompilationProblem | |
Disconnected |