Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Language.LSP.Protocol.Message
Synopsis
- data NotificationMessage = NotificationMessage {}
- data RequestMessage = RequestMessage {}
- data ResponseError = ResponseError {
- _code :: LSPErrorCodes |? ErrorCodes
- _message :: Text
- _xdata :: Maybe Value
- data ResponseMessage = ResponseMessage {}
- data TNotificationMessage (m :: Method f Notification) = TNotificationMessage {
- _jsonrpc :: Text
- _method :: SMethod m
- _params :: MessageParams m
- data TRequestMessage (m :: Method f Request) = TRequestMessage {}
- data TResponseError (m :: Method f Request) = TResponseError {
- _code :: LSPErrorCodes |? ErrorCodes
- _message :: Text
- _xdata :: Maybe (ErrorData m)
- toUntypedResponseError :: ToJSON (ErrorData m) => TResponseError m -> ResponseError
- data TResponseMessage (m :: Method f Request) = TResponseMessage {
- _jsonrpc :: Text
- _id :: Maybe (LspId m)
- _result :: Either ResponseError (MessageResult m)
- data TCustomMessage s f t where
- ReqMess :: TRequestMessage (Method_CustomMethod s :: Method f Request) -> TCustomMessage s f Request
- NotMess :: TNotificationMessage (Method_CustomMethod s :: Method f Notification) -> TCustomMessage s f Notification
- type family TMessage m where ...
- type TClientMessage (m :: Method ClientToServer t) = TMessage m
- type TServerMessage (m :: Method ServerToClient t) = TMessage m
- addNullField :: String -> Value -> Value
- data LspId (m :: Method f Request)
- data SomeLspId where
- data MessageDirection
- data MessageKind
- data SMessageDirection (f :: MessageDirection) where
- data SMessageKind (f :: MessageKind) where
- data FromServerMessage' a where
- FromServerMess :: forall t (m :: Method ServerToClient t) a. SMethod m -> TMessage m -> FromServerMessage' a
- FromServerRsp :: forall (m :: Method ClientToServer Request) a. a m -> TResponseMessage m -> FromServerMessage' a
- type FromServerMessage = FromServerMessage' SMethod
- fromServerNot :: forall (m :: Method ServerToClient Notification). TMessage m ~ TNotificationMessage m => TNotificationMessage m -> FromServerMessage
- fromServerReq :: forall (m :: Method ServerToClient Request). TMessage m ~ TRequestMessage m => TRequestMessage m -> FromServerMessage
- data FromClientMessage' a where
- FromClientMess :: forall t (m :: Method ClientToServer t) a. SMethod m -> TMessage m -> FromClientMessage' a
- FromClientRsp :: forall (m :: Method ServerToClient Request) a. a m -> TResponseMessage m -> FromClientMessage' a
- type FromClientMessage = FromClientMessage' SMethod
- fromClientNot :: forall (m :: Method ClientToServer Notification). TMessage m ~ TNotificationMessage m => TNotificationMessage m -> FromClientMessage
- fromClientReq :: forall (m :: Method ClientToServer Request). TMessage m ~ TRequestMessage m => TRequestMessage m -> FromClientMessage
- type LookupFunc f a = forall (m :: Method f Request). LspId m -> Maybe (SMethod m, a m)
- parseServerMessage :: LookupFunc ClientToServer a -> Value -> Parser (FromServerMessage' a)
- parseClientMessage :: LookupFunc ServerToClient a -> Value -> Parser (FromClientMessage' a)
- clientResponseJSON :: SClientMethod m -> (HasJSON (TResponseMessage m) => x) -> x
- serverResponseJSON :: SServerMethod m -> (HasJSON (TResponseMessage m) => x) -> x
- clientMethodJSON :: SClientMethod m -> (ToJSON (TClientMessage m) => x) -> x
- serverMethodJSON :: SServerMethod m -> (ToJSON (TServerMessage m) => x) -> x
- type HasJSON a = (ToJSON a, FromJSON a, Eq a)
- data ClientNotOrReq m where
- IsClientNot :: (HasJSON (TClientMessage m), TMessage m ~ TNotificationMessage m) => ClientNotOrReq (m :: Method ClientToServer Notification)
- IsClientReq :: forall (m :: Method ClientToServer Request). (HasJSON (TClientMessage m), HasJSON (TResponseMessage m), TMessage m ~ TRequestMessage m) => ClientNotOrReq m
- IsClientEither :: ClientNotOrReq (Method_CustomMethod s)
- data ServerNotOrReq m where
- IsServerNot :: (HasJSON (TServerMessage m), TMessage m ~ TNotificationMessage m) => ServerNotOrReq (m :: Method ServerToClient Notification)
- IsServerReq :: forall (m :: Method ServerToClient Request). (HasJSON (TServerMessage m), HasJSON (TResponseMessage m), TMessage m ~ TRequestMessage m) => ServerNotOrReq m
- IsServerEither :: ServerNotOrReq (Method_CustomMethod s)
- splitClientMethod :: SClientMethod m -> ClientNotOrReq m
- splitServerMethod :: SServerMethod m -> ServerNotOrReq m
- data CustomEq m1 m2 where
- CustomEq :: (m1 ~ (Method_CustomMethod s :: Method f t1), m2 ~ (Method_CustomMethod s :: Method f t2)) => {..} -> CustomEq m1 m2
- runEq :: t1 ~ t2 => (SMethod m1 -> SMethod m2 -> Maybe (Either (CustomEq m1 m2) (m1 :~~: m2))) -> SMethod (m1 :: Method f t1) -> SMethod (m2 :: Method f t2) -> Maybe (m1 :~~: m2)
- mEqServer :: SServerMethod m1 -> SServerMethod m2 -> Maybe (Either (CustomEq m1 m2) (m1 :~~: m2))
- mEqClient :: SClientMethod m1 -> SClientMethod m2 -> Maybe (Either (CustomEq m1 m2) (m1 :~~: m2))
- data Method f t where
- Method_TextDocumentImplementation :: Method ClientToServer Request
- Method_TextDocumentTypeDefinition :: Method ClientToServer Request
- Method_WorkspaceWorkspaceFolders :: Method ServerToClient Request
- Method_WorkspaceConfiguration :: Method ServerToClient Request
- Method_TextDocumentDocumentColor :: Method ClientToServer Request
- Method_TextDocumentColorPresentation :: Method ClientToServer Request
- Method_TextDocumentFoldingRange :: Method ClientToServer Request
- Method_TextDocumentDeclaration :: Method ClientToServer Request
- Method_TextDocumentSelectionRange :: Method ClientToServer Request
- Method_WindowWorkDoneProgressCreate :: Method ServerToClient Request
- Method_TextDocumentPrepareCallHierarchy :: Method ClientToServer Request
- Method_CallHierarchyIncomingCalls :: Method ClientToServer Request
- Method_CallHierarchyOutgoingCalls :: Method ClientToServer Request
- Method_TextDocumentSemanticTokensFull :: Method ClientToServer Request
- Method_TextDocumentSemanticTokensFullDelta :: Method ClientToServer Request
- Method_TextDocumentSemanticTokensRange :: Method ClientToServer Request
- Method_WorkspaceSemanticTokensRefresh :: Method ServerToClient Request
- Method_WindowShowDocument :: Method ServerToClient Request
- Method_TextDocumentLinkedEditingRange :: Method ClientToServer Request
- Method_WorkspaceWillCreateFiles :: Method ClientToServer Request
- Method_WorkspaceWillRenameFiles :: Method ClientToServer Request
- Method_WorkspaceWillDeleteFiles :: Method ClientToServer Request
- Method_TextDocumentMoniker :: Method ClientToServer Request
- Method_TextDocumentPrepareTypeHierarchy :: Method ClientToServer Request
- Method_TypeHierarchySupertypes :: Method ClientToServer Request
- Method_TypeHierarchySubtypes :: Method ClientToServer Request
- Method_TextDocumentInlineValue :: Method ClientToServer Request
- Method_WorkspaceInlineValueRefresh :: Method ServerToClient Request
- Method_TextDocumentInlayHint :: Method ClientToServer Request
- Method_InlayHintResolve :: Method ClientToServer Request
- Method_WorkspaceInlayHintRefresh :: Method ServerToClient Request
- Method_TextDocumentDiagnostic :: Method ClientToServer Request
- Method_WorkspaceDiagnostic :: Method ClientToServer Request
- Method_WorkspaceDiagnosticRefresh :: Method ServerToClient Request
- Method_ClientRegisterCapability :: Method ServerToClient Request
- Method_ClientUnregisterCapability :: Method ServerToClient Request
- Method_Initialize :: Method ClientToServer Request
- Method_Shutdown :: Method ClientToServer Request
- Method_WindowShowMessageRequest :: Method ServerToClient Request
- Method_TextDocumentWillSaveWaitUntil :: Method ClientToServer Request
- Method_TextDocumentCompletion :: Method ClientToServer Request
- Method_CompletionItemResolve :: Method ClientToServer Request
- Method_TextDocumentHover :: Method ClientToServer Request
- Method_TextDocumentSignatureHelp :: Method ClientToServer Request
- Method_TextDocumentDefinition :: Method ClientToServer Request
- Method_TextDocumentReferences :: Method ClientToServer Request
- Method_TextDocumentDocumentHighlight :: Method ClientToServer Request
- Method_TextDocumentDocumentSymbol :: Method ClientToServer Request
- Method_TextDocumentCodeAction :: Method ClientToServer Request
- Method_CodeActionResolve :: Method ClientToServer Request
- Method_WorkspaceSymbol :: Method ClientToServer Request
- Method_WorkspaceSymbolResolve :: Method ClientToServer Request
- Method_TextDocumentCodeLens :: Method ClientToServer Request
- Method_CodeLensResolve :: Method ClientToServer Request
- Method_WorkspaceCodeLensRefresh :: Method ServerToClient Request
- Method_TextDocumentDocumentLink :: Method ClientToServer Request
- Method_DocumentLinkResolve :: Method ClientToServer Request
- Method_TextDocumentFormatting :: Method ClientToServer Request
- Method_TextDocumentRangeFormatting :: Method ClientToServer Request
- Method_TextDocumentOnTypeFormatting :: Method ClientToServer Request
- Method_TextDocumentRename :: Method ClientToServer Request
- Method_TextDocumentPrepareRename :: Method ClientToServer Request
- Method_WorkspaceExecuteCommand :: Method ClientToServer Request
- Method_WorkspaceApplyEdit :: Method ServerToClient Request
- Method_WorkspaceDidChangeWorkspaceFolders :: Method ClientToServer Notification
- Method_WindowWorkDoneProgressCancel :: Method ClientToServer Notification
- Method_WorkspaceDidCreateFiles :: Method ClientToServer Notification
- Method_WorkspaceDidRenameFiles :: Method ClientToServer Notification
- Method_WorkspaceDidDeleteFiles :: Method ClientToServer Notification
- Method_NotebookDocumentDidOpen :: Method ClientToServer Notification
- Method_NotebookDocumentDidChange :: Method ClientToServer Notification
- Method_NotebookDocumentDidSave :: Method ClientToServer Notification
- Method_NotebookDocumentDidClose :: Method ClientToServer Notification
- Method_Initialized :: Method ClientToServer Notification
- Method_Exit :: Method ClientToServer Notification
- Method_WorkspaceDidChangeConfiguration :: Method ClientToServer Notification
- Method_WindowShowMessage :: Method ServerToClient Notification
- Method_WindowLogMessage :: Method ServerToClient Notification
- Method_TelemetryEvent :: Method ServerToClient Notification
- Method_TextDocumentDidOpen :: Method ClientToServer Notification
- Method_TextDocumentDidChange :: Method ClientToServer Notification
- Method_TextDocumentDidClose :: Method ClientToServer Notification
- Method_TextDocumentDidSave :: Method ClientToServer Notification
- Method_TextDocumentWillSave :: Method ClientToServer Notification
- Method_WorkspaceDidChangeWatchedFiles :: Method ClientToServer Notification
- Method_TextDocumentPublishDiagnostics :: Method ServerToClient Notification
- Method_SetTrace :: Method ClientToServer Notification
- Method_LogTrace :: Method ServerToClient Notification
- Method_CancelRequest :: Method f Notification
- Method_Progress :: Method f Notification
- Method_CustomMethod :: Symbol -> Method f t
- type family MessageParams (m :: Method f t) where ...
- type family MessageResult (m :: Method f t) where ...
- type family ErrorData (m :: Method f t) where ...
- type family RegistrationOptions (m :: Method f t) where ...
- data SMethod m where
- SMethod_TextDocumentImplementation :: SMethod Method_TextDocumentImplementation
- SMethod_TextDocumentTypeDefinition :: SMethod Method_TextDocumentTypeDefinition
- SMethod_WorkspaceWorkspaceFolders :: SMethod Method_WorkspaceWorkspaceFolders
- SMethod_WorkspaceConfiguration :: SMethod Method_WorkspaceConfiguration
- SMethod_TextDocumentDocumentColor :: SMethod Method_TextDocumentDocumentColor
- SMethod_TextDocumentColorPresentation :: SMethod Method_TextDocumentColorPresentation
- SMethod_TextDocumentFoldingRange :: SMethod Method_TextDocumentFoldingRange
- SMethod_TextDocumentDeclaration :: SMethod Method_TextDocumentDeclaration
- SMethod_TextDocumentSelectionRange :: SMethod Method_TextDocumentSelectionRange
- SMethod_WindowWorkDoneProgressCreate :: SMethod Method_WindowWorkDoneProgressCreate
- SMethod_TextDocumentPrepareCallHierarchy :: SMethod Method_TextDocumentPrepareCallHierarchy
- SMethod_CallHierarchyIncomingCalls :: SMethod Method_CallHierarchyIncomingCalls
- SMethod_CallHierarchyOutgoingCalls :: SMethod Method_CallHierarchyOutgoingCalls
- SMethod_TextDocumentSemanticTokensFull :: SMethod Method_TextDocumentSemanticTokensFull
- SMethod_TextDocumentSemanticTokensFullDelta :: SMethod Method_TextDocumentSemanticTokensFullDelta
- SMethod_TextDocumentSemanticTokensRange :: SMethod Method_TextDocumentSemanticTokensRange
- SMethod_WorkspaceSemanticTokensRefresh :: SMethod Method_WorkspaceSemanticTokensRefresh
- SMethod_WindowShowDocument :: SMethod Method_WindowShowDocument
- SMethod_TextDocumentLinkedEditingRange :: SMethod Method_TextDocumentLinkedEditingRange
- SMethod_WorkspaceWillCreateFiles :: SMethod Method_WorkspaceWillCreateFiles
- SMethod_WorkspaceWillRenameFiles :: SMethod Method_WorkspaceWillRenameFiles
- SMethod_WorkspaceWillDeleteFiles :: SMethod Method_WorkspaceWillDeleteFiles
- SMethod_TextDocumentMoniker :: SMethod Method_TextDocumentMoniker
- SMethod_TextDocumentPrepareTypeHierarchy :: SMethod Method_TextDocumentPrepareTypeHierarchy
- SMethod_TypeHierarchySupertypes :: SMethod Method_TypeHierarchySupertypes
- SMethod_TypeHierarchySubtypes :: SMethod Method_TypeHierarchySubtypes
- SMethod_TextDocumentInlineValue :: SMethod Method_TextDocumentInlineValue
- SMethod_WorkspaceInlineValueRefresh :: SMethod Method_WorkspaceInlineValueRefresh
- SMethod_TextDocumentInlayHint :: SMethod Method_TextDocumentInlayHint
- SMethod_InlayHintResolve :: SMethod Method_InlayHintResolve
- SMethod_WorkspaceInlayHintRefresh :: SMethod Method_WorkspaceInlayHintRefresh
- SMethod_TextDocumentDiagnostic :: SMethod Method_TextDocumentDiagnostic
- SMethod_WorkspaceDiagnostic :: SMethod Method_WorkspaceDiagnostic
- SMethod_WorkspaceDiagnosticRefresh :: SMethod Method_WorkspaceDiagnosticRefresh
- SMethod_ClientRegisterCapability :: SMethod Method_ClientRegisterCapability
- SMethod_ClientUnregisterCapability :: SMethod Method_ClientUnregisterCapability
- SMethod_Initialize :: SMethod Method_Initialize
- SMethod_Shutdown :: SMethod Method_Shutdown
- SMethod_WindowShowMessageRequest :: SMethod Method_WindowShowMessageRequest
- SMethod_TextDocumentWillSaveWaitUntil :: SMethod Method_TextDocumentWillSaveWaitUntil
- SMethod_TextDocumentCompletion :: SMethod Method_TextDocumentCompletion
- SMethod_CompletionItemResolve :: SMethod Method_CompletionItemResolve
- SMethod_TextDocumentHover :: SMethod Method_TextDocumentHover
- SMethod_TextDocumentSignatureHelp :: SMethod Method_TextDocumentSignatureHelp
- SMethod_TextDocumentDefinition :: SMethod Method_TextDocumentDefinition
- SMethod_TextDocumentReferences :: SMethod Method_TextDocumentReferences
- SMethod_TextDocumentDocumentHighlight :: SMethod Method_TextDocumentDocumentHighlight
- SMethod_TextDocumentDocumentSymbol :: SMethod Method_TextDocumentDocumentSymbol
- SMethod_TextDocumentCodeAction :: SMethod Method_TextDocumentCodeAction
- SMethod_CodeActionResolve :: SMethod Method_CodeActionResolve
- SMethod_WorkspaceSymbol :: SMethod Method_WorkspaceSymbol
- SMethod_WorkspaceSymbolResolve :: SMethod Method_WorkspaceSymbolResolve
- SMethod_TextDocumentCodeLens :: SMethod Method_TextDocumentCodeLens
- SMethod_CodeLensResolve :: SMethod Method_CodeLensResolve
- SMethod_WorkspaceCodeLensRefresh :: SMethod Method_WorkspaceCodeLensRefresh
- SMethod_TextDocumentDocumentLink :: SMethod Method_TextDocumentDocumentLink
- SMethod_DocumentLinkResolve :: SMethod Method_DocumentLinkResolve
- SMethod_TextDocumentFormatting :: SMethod Method_TextDocumentFormatting
- SMethod_TextDocumentRangeFormatting :: SMethod Method_TextDocumentRangeFormatting
- SMethod_TextDocumentOnTypeFormatting :: SMethod Method_TextDocumentOnTypeFormatting
- SMethod_TextDocumentRename :: SMethod Method_TextDocumentRename
- SMethod_TextDocumentPrepareRename :: SMethod Method_TextDocumentPrepareRename
- SMethod_WorkspaceExecuteCommand :: SMethod Method_WorkspaceExecuteCommand
- SMethod_WorkspaceApplyEdit :: SMethod Method_WorkspaceApplyEdit
- SMethod_WorkspaceDidChangeWorkspaceFolders :: SMethod Method_WorkspaceDidChangeWorkspaceFolders
- SMethod_WindowWorkDoneProgressCancel :: SMethod Method_WindowWorkDoneProgressCancel
- SMethod_WorkspaceDidCreateFiles :: SMethod Method_WorkspaceDidCreateFiles
- SMethod_WorkspaceDidRenameFiles :: SMethod Method_WorkspaceDidRenameFiles
- SMethod_WorkspaceDidDeleteFiles :: SMethod Method_WorkspaceDidDeleteFiles
- SMethod_NotebookDocumentDidOpen :: SMethod Method_NotebookDocumentDidOpen
- SMethod_NotebookDocumentDidChange :: SMethod Method_NotebookDocumentDidChange
- SMethod_NotebookDocumentDidSave :: SMethod Method_NotebookDocumentDidSave
- SMethod_NotebookDocumentDidClose :: SMethod Method_NotebookDocumentDidClose
- SMethod_Initialized :: SMethod Method_Initialized
- SMethod_Exit :: SMethod Method_Exit
- SMethod_WorkspaceDidChangeConfiguration :: SMethod Method_WorkspaceDidChangeConfiguration
- SMethod_WindowShowMessage :: SMethod Method_WindowShowMessage
- SMethod_WindowLogMessage :: SMethod Method_WindowLogMessage
- SMethod_TelemetryEvent :: SMethod Method_TelemetryEvent
- SMethod_TextDocumentDidOpen :: SMethod Method_TextDocumentDidOpen
- SMethod_TextDocumentDidChange :: SMethod Method_TextDocumentDidChange
- SMethod_TextDocumentDidClose :: SMethod Method_TextDocumentDidClose
- SMethod_TextDocumentDidSave :: SMethod Method_TextDocumentDidSave
- SMethod_TextDocumentWillSave :: SMethod Method_TextDocumentWillSave
- SMethod_WorkspaceDidChangeWatchedFiles :: SMethod Method_WorkspaceDidChangeWatchedFiles
- SMethod_TextDocumentPublishDiagnostics :: SMethod Method_TextDocumentPublishDiagnostics
- SMethod_SetTrace :: SMethod Method_SetTrace
- SMethod_LogTrace :: SMethod Method_LogTrace
- SMethod_CancelRequest :: SMethod Method_CancelRequest
- SMethod_Progress :: SMethod Method_Progress
- SMethod_CustomMethod :: forall s. KnownSymbol s => Proxy s -> SMethod (Method_CustomMethod s)
- data SomeMethod where
- SomeMethod :: forall m. SMethod m -> SomeMethod
- someMethodToMethodString :: SomeMethod -> String
- methodStringToSomeMethod :: String -> SomeMethod
- messageDirection :: forall f t (m :: Method f t). SMethod m -> SMessageDirection f
- messageKind :: forall f t (m :: Method f t). SMethod m -> SMessageKind t
- isOptionalMethod :: SomeMethod -> Bool
- type SClientMethod (m :: Method ClientToServer t) = SMethod m
- type SServerMethod (m :: Method ServerToClient t) = SMethod m
- data SomeClientMethod = forall t (m :: Method ClientToServer t). SomeClientMethod (SMethod m)
- data SomeServerMethod = forall t (m :: Method ServerToClient t). SomeServerMethod (SMethod m)
- someClientMethod :: SMethod m -> Maybe SomeClientMethod
- someServerMethod :: SMethod m -> Maybe SomeServerMethod
- data TRegistration (m :: Method ClientToServer t) = TRegistration {
- _id :: Text
- _method :: SClientMethod m
- _registerOptions :: !(Maybe (RegistrationOptions m))
- regHelper :: forall m x. SMethod m -> (Show (RegistrationOptions m) => ToJSON (RegistrationOptions m) => FromJSON (RegistrationOptions m) => x) -> x
- data SomeRegistration = forall t (m :: Method ClientToServer t). SomeRegistration (TRegistration m)
- toUntypedRegistration :: TRegistration m -> Registration
- toSomeRegistration :: Registration -> Maybe SomeRegistration
- data TUnregistration (m :: Method ClientToServer t) = TUnregistration {}
- data SomeUnregistration = forall t (m :: Method ClientToServer t). SomeUnregistration (TUnregistration m)
- toUntypedUnregistration :: TUnregistration m -> Unregistration
- toSomeUnregistration :: Unregistration -> Maybe SomeUnregistration
Messages
LSP protocol message types and metadata
data NotificationMessage #
Notification message type as defined in the spec.
Constructors
NotificationMessage | |
Instances
data RequestMessage #
Request message type as defined in the spec.
Constructors
RequestMessage | |
Instances
data ResponseError #
Response error type as defined in the spec.
Constructors
ResponseError | |
Fields
|
Instances
data ResponseMessage #
Response message type as defined in the spec.
Constructors
ResponseMessage | |
Instances
data TNotificationMessage (m :: Method f Notification) #
Typed notification message, containing the correct parameter payload.
Constructors
TNotificationMessage | |
Fields
|
Instances
data TRequestMessage (m :: Method f Request) #
Typed request message, containing the correct parameter payload.
Constructors
TRequestMessage | |
Instances
data TResponseError (m :: Method f Request) #
Constructors
TResponseError | |
Fields
|
Instances
toUntypedResponseError :: ToJSON (ErrorData m) => TResponseError m -> ResponseError #
data TResponseMessage (m :: Method f Request) #
A typed response message with a correct result payload.
Constructors
TResponseMessage | |
Fields
|
Instances
data TCustomMessage s f t where #
A typed custom message. A special data type is needed to distinguish between notifications and requests, since a CustomMethod can be both!
Constructors
ReqMess :: TRequestMessage (Method_CustomMethod s :: Method f Request) -> TCustomMessage s f Request | |
NotMess :: TNotificationMessage (Method_CustomMethod s :: Method f Notification) -> TCustomMessage s f Notification |
Instances
type family TMessage m where ... #
Map a method to the Request/Notification type with the correct payload.
Equations
TMessage (Method_CustomMethod s :: Method f t) = TCustomMessage s f t | |
TMessage (m :: Method f Request) = TRequestMessage m | |
TMessage (m :: Method f Notification) = TNotificationMessage m |
type TClientMessage (m :: Method ClientToServer t) = TMessage m #
type TServerMessage (m :: Method ServerToClient t) = TMessage m #
addNullField :: String -> Value -> Value #
Replace a missing field in an object with a null field, to simplify parsing This is a hack to allow other types than Maybe to work like Maybe in allowing the field to be missing. See also this issue: https://github.com/haskell/aeson/issues/646
data LspId (m :: Method f Request) #
Id used for a request, Can be either a String or an Int
Instances
FromJSON (LspId m) # | |
Defined in Language.LSP.Protocol.Message.LspId | |
ToJSON (LspId m) # | |
Defined in Language.LSP.Protocol.Message.LspId | |
Generic (LspId m) # | |
Read (LspId m) # | |
Show (LspId m) # | |
Eq (LspId m) # | |
Ord (LspId m) # | |
Defined in Language.LSP.Protocol.Message.LspId | |
Hashable (LspId m) # | |
Defined in Language.LSP.Protocol.Message.LspId | |
Pretty (LspId m) # | |
Defined in Language.LSP.Protocol.Message.LspId | |
IxOrd (LspId :: Method f 'Request -> Type) # | |
HasId (TResponseMessage m) (Maybe (LspId m)) # | |
Defined in Language.LSP.Protocol.Message.Lens Methods id :: Lens' (TResponseMessage m) (Maybe (LspId m)) # | |
HasId (TRequestMessage m) (LspId m) # | |
Defined in Language.LSP.Protocol.Message.Lens Methods id :: Lens' (TRequestMessage m) (LspId m) # | |
type Rep (LspId m) # | |
Defined in Language.LSP.Protocol.Message.LspId type Rep (LspId m) = D1 ('MetaData "LspId" "Language.LSP.Protocol.Message.LspId" "lsp-types-2.0.2.0-6ldEQfFkAQaDyl5nknNRSX" 'False) (C1 ('MetaCons "IdInt" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int32)) :+: C1 ('MetaCons "IdString" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text))) | |
type Base (LspId :: Method f 'Request -> Type) # | |
data MessageDirection #
Which direction messages are sent in.
Constructors
ServerToClient | |
ClientToServer |
data SMessageDirection (f :: MessageDirection) where #
Singleton type for MessageDirection
.
data SMessageKind (f :: MessageKind) where #
Singleton type for MessageKind
.
Constructors
SNotification :: SMessageKind Notification | |
SRequest :: SMessageKind Request | |
SBothTypes :: SMessageKind f |
Parsing LSP messages
data FromServerMessage' a where #
Constructors
FromServerMess :: forall t (m :: Method ServerToClient t) a. SMethod m -> TMessage m -> FromServerMessage' a | |
FromServerRsp :: forall (m :: Method ClientToServer Request) a. a m -> TResponseMessage m -> FromServerMessage' a |
Instances
ToJSON FromServerMessage # | |
Defined in Language.LSP.Protocol.Message.Parsing Methods toJSON :: FromServerMessage -> Value # toEncoding :: FromServerMessage -> Encoding # toJSONList :: [FromServerMessage] -> Value # toEncodingList :: [FromServerMessage] -> Encoding # omitField :: FromServerMessage -> Bool # | |
Show FromServerMessage # | |
Defined in Language.LSP.Protocol.Message.Parsing Methods showsPrec :: Int -> FromServerMessage -> ShowS show :: FromServerMessage -> String showList :: [FromServerMessage] -> ShowS | |
Eq FromServerMessage # | |
Defined in Language.LSP.Protocol.Message.Parsing Methods (==) :: FromServerMessage -> FromServerMessage -> Bool (/=) :: FromServerMessage -> FromServerMessage -> Bool |
fromServerNot :: forall (m :: Method ServerToClient Notification). TMessage m ~ TNotificationMessage m => TNotificationMessage m -> FromServerMessage #
fromServerReq :: forall (m :: Method ServerToClient Request). TMessage m ~ TRequestMessage m => TRequestMessage m -> FromServerMessage #
data FromClientMessage' a where #
Constructors
FromClientMess :: forall t (m :: Method ClientToServer t) a. SMethod m -> TMessage m -> FromClientMessage' a | |
FromClientRsp :: forall (m :: Method ServerToClient Request) a. a m -> TResponseMessage m -> FromClientMessage' a |
Instances
ToJSON FromClientMessage # | |
Defined in Language.LSP.Protocol.Message.Parsing Methods toJSON :: FromClientMessage -> Value # toEncoding :: FromClientMessage -> Encoding # toJSONList :: [FromClientMessage] -> Value # toEncodingList :: [FromClientMessage] -> Encoding # omitField :: FromClientMessage -> Bool # |
fromClientNot :: forall (m :: Method ClientToServer Notification). TMessage m ~ TNotificationMessage m => TNotificationMessage m -> FromClientMessage #
fromClientReq :: forall (m :: Method ClientToServer Request). TMessage m ~ TRequestMessage m => TRequestMessage m -> FromClientMessage #
parseServerMessage :: LookupFunc ClientToServer a -> Value -> Parser (FromServerMessage' a) #
parseClientMessage :: LookupFunc ServerToClient a -> Value -> Parser (FromClientMessage' a) #
clientResponseJSON :: SClientMethod m -> (HasJSON (TResponseMessage m) => x) -> x #
serverResponseJSON :: SServerMethod m -> (HasJSON (TResponseMessage m) => x) -> x #
clientMethodJSON :: SClientMethod m -> (ToJSON (TClientMessage m) => x) -> x #
serverMethodJSON :: SServerMethod m -> (ToJSON (TServerMessage m) => x) -> x #
data ClientNotOrReq m where #
Constructors
IsClientNot :: (HasJSON (TClientMessage m), TMessage m ~ TNotificationMessage m) => ClientNotOrReq (m :: Method ClientToServer Notification) | |
IsClientReq :: forall (m :: Method ClientToServer Request). (HasJSON (TClientMessage m), HasJSON (TResponseMessage m), TMessage m ~ TRequestMessage m) => ClientNotOrReq m | |
IsClientEither :: ClientNotOrReq (Method_CustomMethod s) |
data ServerNotOrReq m where #
Constructors
IsServerNot :: (HasJSON (TServerMessage m), TMessage m ~ TNotificationMessage m) => ServerNotOrReq (m :: Method ServerToClient Notification) | |
IsServerReq :: forall (m :: Method ServerToClient Request). (HasJSON (TServerMessage m), HasJSON (TResponseMessage m), TMessage m ~ TRequestMessage m) => ServerNotOrReq m | |
IsServerEither :: ServerNotOrReq (Method_CustomMethod s) |
splitClientMethod :: SClientMethod m -> ClientNotOrReq m #
splitServerMethod :: SServerMethod m -> ServerNotOrReq m #
Given a witness that two custom methods are of the same type, produce a witness that the methods are the same
Constructors
CustomEq | |
Fields
|
runEq :: t1 ~ t2 => (SMethod m1 -> SMethod m2 -> Maybe (Either (CustomEq m1 m2) (m1 :~~: m2))) -> SMethod (m1 :: Method f t1) -> SMethod (m2 :: Method f t2) -> Maybe (m1 :~~: m2) #
mEqServer :: SServerMethod m1 -> SServerMethod m2 -> Maybe (Either (CustomEq m1 m2) (m1 :~~: m2)) #
Heterogeneous equality on singleton server methods
mEqClient :: SClientMethod m1 -> SClientMethod m2 -> Maybe (Either (CustomEq m1 m2) (m1 :~~: m2)) #
Heterogeneous equality on singleton client methods
Methods
Main LSP method types and functions
A type representing a LSP method (or class of methods), intended to be used mostly at the type level.
Constructors
type family MessageParams (m :: Method f t) where ... #
Maps a LSP method to its parameter type.
Equations
type family MessageResult (m :: Method f t) where ... #
Maps a LSP method to its result type.
Equations
type family ErrorData (m :: Method f t) where ... #
Maps a LSP method to its error data type.
Equations
type family RegistrationOptions (m :: Method f t) where ... #
Maps a LSP method to its registration options type.
Equations
A singleton type for Method
.
Constructors
Instances
data SomeMethod where #
A method which isn't statically known.
Constructors
SomeMethod :: forall m. SMethod m -> SomeMethod |
Instances
someMethodToMethodString :: SomeMethod -> String #
Turn a SomeMethod
into its LSP method string.
methodStringToSomeMethod :: String -> SomeMethod #
Turn a LSP method string into a SomeMethod
.
messageDirection :: forall f t (m :: Method f t). SMethod m -> SMessageDirection f #
Get a singleton witness for the message direction of a SMethod
.
messageKind :: forall f t (m :: Method f t). SMethod m -> SMessageKind t #
Get a singleton witness for the message kind of a SMethod
.
Helpers for working with methods
isOptionalMethod :: SomeMethod -> Bool #
Is this an "optional" method which servers and clients are allowed to ignore?
type SClientMethod (m :: Method ClientToServer t) = SMethod m #
type SServerMethod (m :: Method ServerToClient t) = SMethod m #
data SomeClientMethod #
Constructors
forall t (m :: Method ClientToServer t). SomeClientMethod (SMethod m) |
Instances
FromJSON SomeClientMethod # | |
Defined in Language.LSP.Protocol.Message.Method Methods parseJSON :: Value -> Parser SomeClientMethod # parseJSONList :: Value -> Parser [SomeClientMethod] # omittedField :: Maybe SomeClientMethod # | |
ToJSON SomeClientMethod # | |
Defined in Language.LSP.Protocol.Message.Method Methods toJSON :: SomeClientMethod -> Value # toEncoding :: SomeClientMethod -> Encoding # toJSONList :: [SomeClientMethod] -> Value # toEncodingList :: [SomeClientMethod] -> Encoding # omitField :: SomeClientMethod -> Bool # | |
Show SomeClientMethod # | |
Defined in Language.LSP.Protocol.Message.Method Methods showsPrec :: Int -> SomeClientMethod -> ShowS show :: SomeClientMethod -> String showList :: [SomeClientMethod] -> ShowS | |
Pretty SomeClientMethod # | |
Defined in Language.LSP.Protocol.Message.Method |
data SomeServerMethod #
Constructors
forall t (m :: Method ServerToClient t). SomeServerMethod (SMethod m) |
Instances
FromJSON SomeServerMethod # | |
Defined in Language.LSP.Protocol.Message.Method Methods parseJSON :: Value -> Parser SomeServerMethod # parseJSONList :: Value -> Parser [SomeServerMethod] # omittedField :: Maybe SomeServerMethod # | |
ToJSON SomeServerMethod # | |
Defined in Language.LSP.Protocol.Message.Method Methods toJSON :: SomeServerMethod -> Value # toEncoding :: SomeServerMethod -> Encoding # toJSONList :: [SomeServerMethod] -> Value # toEncodingList :: [SomeServerMethod] -> Encoding # omitField :: SomeServerMethod -> Bool # | |
Show SomeServerMethod # | |
Defined in Language.LSP.Protocol.Message.Method Methods showsPrec :: Int -> SomeServerMethod -> ShowS show :: SomeServerMethod -> String showList :: [SomeServerMethod] -> ShowS | |
Pretty SomeServerMethod # | |
Defined in Language.LSP.Protocol.Message.Method |
someClientMethod :: SMethod m -> Maybe SomeClientMethod #
someServerMethod :: SMethod m -> Maybe SomeServerMethod #
LSP registrations
data TRegistration (m :: Method ClientToServer t) #
Typed registration type, with correct options.
Constructors
TRegistration | |
Fields
|
Instances
ToJSON (TRegistration m) # | |
Defined in Language.LSP.Protocol.Message.Registration Methods toJSON :: TRegistration m -> Value # toEncoding :: TRegistration m -> Encoding # toJSONList :: [TRegistration m] -> Value # toEncodingList :: [TRegistration m] -> Encoding # omitField :: TRegistration m -> Bool # | |
Generic (TRegistration m) # | |
Defined in Language.LSP.Protocol.Message.Registration Associated Types type Rep (TRegistration m) :: Type -> Type Methods from :: TRegistration m -> Rep (TRegistration m) x to :: Rep (TRegistration m) x -> TRegistration m | |
Show (RegistrationOptions m) => Show (TRegistration m) # | |
Defined in Language.LSP.Protocol.Message.Registration Methods showsPrec :: Int -> TRegistration m -> ShowS show :: TRegistration m -> String showList :: [TRegistration m] -> ShowS | |
Eq (RegistrationOptions m) => Eq (TRegistration m) # | |
Defined in Language.LSP.Protocol.Message.Registration Methods (==) :: TRegistration m -> TRegistration m -> Bool (/=) :: TRegistration m -> TRegistration m -> Bool | |
Pretty (TRegistration m) # | |
Defined in Language.LSP.Protocol.Message.Registration | |
HasId (TRegistration m) Text # | |
Defined in Language.LSP.Protocol.Message.Lens Methods id :: Lens' (TRegistration m) Text # | |
a ~ Maybe (RegistrationOptions m) => HasRegisterOptions (TRegistration m) a # | |
Defined in Language.LSP.Protocol.Message.Lens Methods registerOptions :: Lens' (TRegistration m) a # | |
HasMethod (TRegistration m) (SClientMethod m) # | |
Defined in Language.LSP.Protocol.Message.Lens Methods method :: Lens' (TRegistration m) (SClientMethod m) # | |
type Rep (TRegistration m) # | |
Defined in Language.LSP.Protocol.Message.Registration type Rep (TRegistration m) = D1 ('MetaData "TRegistration" "Language.LSP.Protocol.Message.Registration" "lsp-types-2.0.2.0-6ldEQfFkAQaDyl5nknNRSX" 'False) (C1 ('MetaCons "TRegistration" 'PrefixI 'True) (S1 ('MetaSel ('Just "_id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "_method") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (SClientMethod m)) :*: S1 ('MetaSel ('Just "_registerOptions") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe (RegistrationOptions m)))))) |
regHelper :: forall m x. SMethod m -> (Show (RegistrationOptions m) => ToJSON (RegistrationOptions m) => FromJSON (RegistrationOptions m) => x) -> x #
data SomeRegistration #
Constructors
forall t (m :: Method ClientToServer t). SomeRegistration (TRegistration m) |
Instances
FromJSON SomeRegistration # | |
Defined in Language.LSP.Protocol.Message.Registration Methods parseJSON :: Value -> Parser SomeRegistration # parseJSONList :: Value -> Parser [SomeRegistration] # omittedField :: Maybe SomeRegistration # | |
ToJSON SomeRegistration # | |
Defined in Language.LSP.Protocol.Message.Registration Methods toJSON :: SomeRegistration -> Value # toEncoding :: SomeRegistration -> Encoding # toJSONList :: [SomeRegistration] -> Value # toEncodingList :: [SomeRegistration] -> Encoding # omitField :: SomeRegistration -> Bool # | |
Show SomeRegistration # | |
Defined in Language.LSP.Protocol.Message.Registration Methods showsPrec :: Int -> SomeRegistration -> ShowS show :: SomeRegistration -> String showList :: [SomeRegistration] -> ShowS | |
Pretty SomeRegistration # | |
Defined in Language.LSP.Protocol.Message.Registration |
toSomeRegistration :: Registration -> Maybe SomeRegistration #
data TUnregistration (m :: Method ClientToServer t) #
Typed unregistration type.
Constructors
TUnregistration | |
Instances
data SomeUnregistration #
Constructors
forall t (m :: Method ClientToServer t). SomeUnregistration (TUnregistration m) |
Instances
FromJSON SomeUnregistration # | |
Defined in Language.LSP.Protocol.Message.Registration Methods parseJSON :: Value -> Parser SomeUnregistration # parseJSONList :: Value -> Parser [SomeUnregistration] # omittedField :: Maybe SomeUnregistration # | |
ToJSON SomeUnregistration # | |
Defined in Language.LSP.Protocol.Message.Registration Methods toJSON :: SomeUnregistration -> Value # toEncoding :: SomeUnregistration -> Encoding # toJSONList :: [SomeUnregistration] -> Value # toEncodingList :: [SomeUnregistration] -> Encoding # omitField :: SomeUnregistration -> Bool # | |
Pretty SomeUnregistration # | |
Defined in Language.LSP.Protocol.Message.Registration |
toSomeUnregistration :: Unregistration -> Maybe SomeUnregistration #