ghcide-2.9.0.0: The core of an IDE

Safe Haskell | None
Language | GHC2021

Development.IDE.LSP.LanguageServer

Synopsis

- runLanguageServer :: forall config a m. Show config => Recorder (WithPriority Log) -> Options -> Handle -> Handle -> config -> (config -> Value -> Either Text config) -> (config -> m config ()) -> (MVar () -> IO (LanguageContextEnv config -> TRequestMessage 'Method_Initialize -> IO (Either (TResponseError 'Method_Initialize) (LanguageContextEnv config, a)), Handlers (m config), (LanguageContextEnv config, a) -> m config <~> IO)) -> IO ()
- setupLSP :: Recorder (WithPriority Log) -> FilePath -> (FilePath -> IO FilePath) -> Handlers (ServerM config) -> (LanguageContextEnv config -> FilePath -> WithHieDb -> ThreadQueue -> IO IdeState) -> MVar () -> IO (LanguageContextEnv config -> TRequestMessage 'Method_Initialize -> IO (Either err (LanguageContextEnv config, IdeState)), Handlers (ServerM config), (LanguageContextEnv config, IdeState) -> ServerM config <~> IO)
- data Log
  - = LogRegisteringIdeConfig !IdeConfiguration
  - | LogReactorThreadException !SomeException
  - | LogReactorMessageActionException !SomeException
  - | LogReactorThreadStopped
  - | LogCancelledRequest !SomeLspId
  - | LogSession Log
  - | LogLspServer LspServerLog
  - | LogServerShutdownMessage
- data ThreadQueue
- runWithWorkerThreads :: Recorder (WithPriority Log) -> FilePath -> (WithHieDb -> ThreadQueue -> IO ()) -> IO ()

# Documentation

runLanguageServer :: forall config a m. Show config => Recorder (WithPriority Log) -> Options -> Handle -> Handle -> config -> (config -> Value -> Either Text config) -> (config -> m config ()) -> (MVar () -> IO (LanguageContextEnv config -> TRequestMessage 'Method_Initialize -> IO (Either (TResponseError 'Method_Initialize) (LanguageContextEnv config, a)), Handlers (m config), (LanguageContextEnv config, a) -> m config <~> IO)) -> IO () #

setupLSP #

Arguments

:: Recorder (WithPriority Log) |
-> FilePath | root directory, see Note [Root Directory]
-> (FilePath -> IO FilePath) | Map root paths to the location of the hiedb for the project
-> Handlers (ServerM config) |
-> (LanguageContextEnv config -> FilePath -> WithHieDb -> ThreadQueue -> IO IdeState) |
-> MVar () |
-> IO (LanguageContextEnv config -> TRequestMessage 'Method_Initialize -> IO (Either err (LanguageContextEnv config, IdeState)), Handlers (ServerM config), (LanguageContextEnv config, IdeState) -> ServerM config <~> IO) |

data Log #

Constructors

LogRegisteringIdeConfig !IdeConfiguration |
LogReactorThreadException !SomeException |
LogReactorMessageActionException !SomeException |
LogReactorThreadStopped |
LogCancelledRequest !SomeLspId |
LogSession Log |
LogLspServer LspServerLog |
LogServerShutdownMessage |

#### Instances

Instances details

Show Log # |
Instance details Defined in Development.IDE.LSP.LanguageServer Methods showsPrec :: Int -> Log -> ShowS # show :: Log -> String # showList :: [Log] -> ShowS #
Pretty Log # |
Instance details Defined in Development.IDE.LSP.LanguageServer Methods pretty :: Log -> Doc ann # prettyList :: [Log] -> Doc ann #

data ThreadQueue #

runWithWorkerThreads :: Recorder (WithPriority Log) -> FilePath -> (WithHieDb -> ThreadQueue -> IO ()) -> IO () #

runWithWorkerThreads create several threads to run the session, db and session loader see Note [Serializing runs in separate thread]