Safe Haskell | None |
---|
Main entry point to the server.
- runWithConfig :: Server b -> Config -> IO b
- startServer :: Bool -> Server ()
- acceptConnection :: Socket -> Server ()
- handleLine :: Handle -> Server ()
- handleMessage :: Handle -> Msg -> Server ()
- writeEmacsConfig :: Handle -> Either Text FayProjectId -> FilePath -> Server ()
- downloadFiles :: Handle -> Either Text FayProjectId -> FilePath -> Server ()
- hoogleDb :: Handle -> FayProjectId -> Text -> Server ()
- hoogleIdent :: Handle -> FayProjectId -> String -> Text -> Server ()
- autoComplete :: Handle -> FayProjectId -> FilePath -> Text -> Server ()
- getDefinition :: Handle -> FayProjectId -> FilePath -> FilePath -> Int -> Int -> Int -> Int -> Server ()
- makeModuleId :: FayModuleId -> ModuleId
- typeInfo :: Handle -> FayProjectId -> String -> Int -> Int -> Int -> Int -> Server ()
- saveTheModule :: Handle -> FayProjectId -> FilePath -> FilePath -> Server ()
- checkModule :: Handle -> FayProjectId -> FilePath -> FilePath -> FilePath -> Server ()
- reply :: (ToJSON a, Show a) => Handle -> a -> Server ()
- close :: Handle -> Server ()
- wait :: FayProjectId -> Callback -> Server ()
- removePoller :: FayProjectId -> Server ()
- poll :: FayProjectId -> Server ()
- getIPI :: FayProjectId -> Server ()
- applyCallbacks :: [Callback] -> (Maybe Int, RunnerMessage) -> Server [Callback]
- getToken :: MVar (Map FilePath FayTutorialToken) -> FayProjectId -> FilePath -> FilePath -> Server FayTutorialToken
- updateFileContents :: MVar (Map FilePath FayTutorialToken) -> FayProjectId -> FilePath -> FilePath -> Server ()
- updateToken :: MVar (Map FilePath FayTutorialToken) -> FilePath -> FilePath -> FayTutorialToken -> Server ()
- withTokens :: (MVar (Map FilePath FayTutorialToken) -> Server a) -> Server a
- getFayProjectId :: Either Text FayProjectId -> Server FayProjectId
- stripSlash :: Text -> Text
- convertMsg :: FilePath -> SourceInfo -> CompileMessage
Documentation
runWithConfig :: Server b -> Config -> IO bSource
Run the given Server command with the config. Good for testing in the repl.
startServer :: Bool -> Server ()Source
Start the server.
acceptConnection :: Socket -> Server ()Source
Accept a connection on the given socket.
handleLine :: Handle -> Server ()Source
Handle a line of input.
handleMessage :: Handle -> Msg -> Server ()Source
Handle any incoming message from the client.
writeEmacsConfig :: Handle -> Either Text FayProjectId -> FilePath -> Server ()Source
Write out the .dir-locals.el file for the project.
downloadFiles :: Handle -> Either Text FayProjectId -> FilePath -> Server ()Source
Download all files in the project, overwriting any local copies.
hoogleIdent :: Handle -> FayProjectId -> String -> Text -> Server ()Source
Hoogle search for an identifier in a module.
autoComplete :: Handle -> FayProjectId -> FilePath -> Text -> Server ()Source
Autocomplete the given prefix replying with a list of completions.
getDefinition :: Handle -> FayProjectId -> FilePath -> FilePath -> Int -> Int -> Int -> Int -> Server ()Source
Get the definition location of the identifier at the given span.
makeModuleId :: FayModuleId -> ModuleIdSource
Print a package:module pair.
typeInfo :: Handle -> FayProjectId -> String -> Int -> Int -> Int -> Int -> Server ()Source
Get type info of span.
saveTheModule :: Handle -> FayProjectId -> FilePath -> FilePath -> Server ()Source
Save the given module.
checkModule :: Handle -> FayProjectId -> FilePath -> FilePath -> FilePath -> Server ()Source
Check the given module. Necessary for flycheck.
:: FayProjectId | The project to poll on. |
-> Callback | Take the message or pass it back. |
-> Server () |
Start poller if there isn't already one running for the given project, and in any case add the given callback to the list. This blocks on the result.
removePoller :: FayProjectId -> Server ()Source
Remove a poller from the polling list and any broadcast callbacks.
poll :: FayProjectId -> Server ()Source
Poll for new messages and apply any queued callbacks to them.
getIPI :: FayProjectId -> Server ()Source
Get initial project information.
applyCallbacks :: [Callback] -> (Maybe Int, RunnerMessage) -> Server [Callback]Source
Applies the given callbacks to the given message. Returns a new list of callbacks. If any of the callbacks are now done, they will be removed from the list.
getToken :: MVar (Map FilePath FayTutorialToken) -> FayProjectId -> FilePath -> FilePath -> Server FayTutorialTokenSource
Get the token of the given file.
updateFileContents :: MVar (Map FilePath FayTutorialToken) -> FayProjectId -> FilePath -> FilePath -> Server ()Source
Update the contents of the given file from the server.
updateToken :: MVar (Map FilePath FayTutorialToken) -> FilePath -> FilePath -> FayTutorialToken -> Server ()Source
Update the token of the given file.
withTokens :: (MVar (Map FilePath FayTutorialToken) -> Server a) -> Server aSource
Do something exclusively with tokens. Due to the fact that flychecking and buffer saving *can* occur simultaneously from Emacs, we don't want those two racing save capabilities.
On the other hand it doesn't matter what order they occur because they'll be saving the same content. So we simply require that any command that uses module tokens needs to happen in an exclusion.
getFayProjectId :: Either Text FayProjectId -> Server FayProjectIdSource
Get the project ID from either a URL or a project ID.
stripSlash :: Text -> TextSource
Strip the trailing slash.
convertMsg :: FilePath -> SourceInfo -> CompileMessageSource
Convert an API message to a more structurally convenient reply message.