haskell-lsp-0.2.0.1: Haskell library for the Microsoft Language Server Protocol

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.LSP.Core

Synopsis

Documentation

data LanguageContextData a Source #

state used by the LSP dispatcher to manage the message loop

type Handler b = b -> IO () Source #

The Handler type captures a function that receives local read-only state a, a function to send a reply message once encoded as a ByteString, and a received message of type b

type InitializeCallback c = (DidChangeConfigurationNotification -> Either Text c, LspFuncs c -> IO (Maybe ResponseError)) Source #

The function in the LSP process that is called once the initialize message is received. Message processing will only continue once this returns, so it should create whatever processes are needed.

data LspFuncs c Source #

Returned to the server on startup, providing ways to interact with the client.

Constructors

LspFuncs 

Fields

type SendFunc = forall a. ToJSON a => a -> IO () Source #

A function to send a message to the client

data Handlers Source #

Callbacks from the language server to the language handler

Constructors

Handlers 

Fields

Instances

data Options Source #

Language Server Protocol options supported by the given language server. These are automatically turned into capabilities reported to the client during initialization.

Instances

data OutMessage Source #

Wrap all the protocol messages into a single type, for use in the language handler in storing the original message

Constructors

ReqHover HoverRequest 
ReqCompletion CompletionRequest 
ReqCompletionItemResolve CompletionItemResolveRequest 
ReqSignatureHelp SignatureHelpRequest 
ReqDefinition DefinitionRequest 
ReqFindReferences ReferencesRequest 
ReqDocumentHighlights DocumentHighlightRequest 
ReqDocumentSymbols DocumentSymbolRequest 
ReqWorkspaceSymbols WorkspaceSymbolRequest 
ReqCodeAction CodeActionRequest 
ReqCodeLens CodeLensRequest 
ReqCodeLensResolve CodeLensResolveRequest 
ReqDocumentFormatting DocumentFormattingRequest 
ReqDocumentRangeFormatting DocumentRangeFormattingRequest 
ReqDocumentOnTypeFormatting DocumentOnTypeFormattingRequest 
ReqRename RenameRequest 
ReqExecuteCommand ExecuteCommandRequest 
RspHover HoverResponse 
RspCompletion CompletionResponse 
RspCompletionItemResolve CompletionItemResolveResponse 
RspSignatureHelp SignatureHelpResponse 
RspDefinition DefinitionResponse 
RspFindReferences ReferencesResponse 
RspDocumentHighlights DocumentHighlightsResponse 
RspDocumentSymbols DocumentSymbolsResponse 
RspWorkspaceSymbols WorkspaceSymbolsResponse 
RspCodeAction CodeActionResponse 
RspCodeLens CodeLensResponse 
RspCodeLensResolve CodeLensResolveResponse 
RspDocumentFormatting DocumentFormattingResponse 
RspDocumentRangeFormatting DocumentRangeFormattingResponse 
RspDocumentOnTypeFormatting DocumentOnTypeFormattingResponse 
RspRename RenameResponse 
RspExecuteCommand ExecuteCommandResponse 
NotInitialized InitializedNotification 
NotDidChangeConfigurationParams DidChangeConfigurationNotification 
NotDidOpenTextDocument DidOpenTextDocumentNotification 
NotDidChangeTextDocument DidChangeTextDocumentNotification 
NotDidCloseTextDocument DidCloseTextDocumentNotification 
NotWillSaveTextDocument WillSaveTextDocumentNotification 
NotDidSaveTextDocument DidSaveTextDocumentNotification 
NotDidChangeWatchedFiles DidChangeWatchedFilesNotification 
NotCancelRequest CancelNotification 
RspFromClient BareResponseMessage 

initializeRequestHandler :: Show c => InitializeCallback c -> TVar (LanguageContextData c) -> InitializeRequest -> IO () Source #

===============================================================

Handlers

setupLogger :: Maybe FilePath -> [String] -> Priority -> IO () Source #

===============================================================

utility

Logger

reverseSortEdit :: WorkspaceEdit -> WorkspaceEdit Source #

The changes in a workspace edit should be applied from the end of the file toward the start. Sort them into this order.