Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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 {}
- 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 Source #
Notification message type as defined in the spec.
Instances
data RequestMessage Source #
Request message type as defined in the spec.
Instances
data ResponseError Source #
Response error type as defined in the spec.
ResponseError | |
|
Instances
data ResponseMessage Source #
Response message type as defined in the spec.
Instances
data TNotificationMessage (m :: Method f Notification) Source #
Typed notification message, containing the correct parameter payload.
Instances
data TRequestMessage (m :: Method f Request) Source #
Typed request message, containing the correct parameter payload.
Instances
data TResponseError (m :: Method f Request) Source #
TResponseError | |
|
Instances
toUntypedResponseError :: ToJSON (ErrorData m) => TResponseError m -> ResponseError Source #
data TResponseMessage (m :: Method f Request) Source #
A typed response message with a correct result payload.
TResponseMessage | |
|
Instances
data TCustomMessage s f t where Source #
A typed custom message. A special data type is needed to distinguish between notifications and requests, since a CustomMethod can be both!
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 ... Source #
Map a method to the Request/Notification type with the correct payload.
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 Source #
type TServerMessage (m :: Method ServerToClient t) = TMessage m Source #
addNullField :: String -> Value -> Value Source #
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) Source #
Id used for a request, Can be either a String or an Int
Instances
data SMessageDirection (f :: MessageDirection) where Source #
Singleton type for MessageDirection
.
data SMessageKind (f :: MessageKind) where Source #
Singleton type for MessageKind
.
Parsing LSP messages
data FromServerMessage' a where Source #
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 Source # | |
Defined in Language.LSP.Protocol.Message.Parsing toJSON :: FromServerMessage -> Value # toEncoding :: FromServerMessage -> Encoding # toJSONList :: [FromServerMessage] -> Value # toEncodingList :: [FromServerMessage] -> Encoding # | |
Show FromServerMessage Source # | |
Defined in Language.LSP.Protocol.Message.Parsing showsPrec :: Int -> FromServerMessage -> ShowS # show :: FromServerMessage -> String # showList :: [FromServerMessage] -> ShowS # | |
Eq FromServerMessage Source # | |
Defined in Language.LSP.Protocol.Message.Parsing (==) :: FromServerMessage -> FromServerMessage -> Bool # (/=) :: FromServerMessage -> FromServerMessage -> Bool # |
fromServerNot :: forall (m :: Method ServerToClient Notification). TMessage m ~ TNotificationMessage m => TNotificationMessage m -> FromServerMessage Source #
fromServerReq :: forall (m :: Method ServerToClient Request). TMessage m ~ TRequestMessage m => TRequestMessage m -> FromServerMessage Source #
data FromClientMessage' a where Source #
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 Source # | |
Defined in Language.LSP.Protocol.Message.Parsing toJSON :: FromClientMessage -> Value # toEncoding :: FromClientMessage -> Encoding # toJSONList :: [FromClientMessage] -> Value # toEncodingList :: [FromClientMessage] -> Encoding # |
fromClientNot :: forall (m :: Method ClientToServer Notification). TMessage m ~ TNotificationMessage m => TNotificationMessage m -> FromClientMessage Source #
fromClientReq :: forall (m :: Method ClientToServer Request). TMessage m ~ TRequestMessage m => TRequestMessage m -> FromClientMessage Source #
parseServerMessage :: LookupFunc ClientToServer a -> Value -> Parser (FromServerMessage' a) Source #
parseClientMessage :: LookupFunc ServerToClient a -> Value -> Parser (FromClientMessage' a) Source #
clientResponseJSON :: SClientMethod m -> (HasJSON (TResponseMessage m) => x) -> x Source #
serverResponseJSON :: SServerMethod m -> (HasJSON (TResponseMessage m) => x) -> x Source #
clientMethodJSON :: SClientMethod m -> (ToJSON (TClientMessage m) => x) -> x Source #
serverMethodJSON :: SServerMethod m -> (ToJSON (TServerMessage m) => x) -> x Source #
data ClientNotOrReq m where Source #
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 Source #
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 Source #
splitServerMethod :: SServerMethod m -> ServerNotOrReq m Source #
data CustomEq m1 m2 where Source #
Given a witness that two custom methods are of the same type, produce a witness that the methods are the same
CustomEq | |
|
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) Source #
mEqServer :: SServerMethod m1 -> SServerMethod m2 -> Maybe (Either (CustomEq m1 m2) (m1 :~~: m2)) Source #
Heterogeneous equality on singleton server methods
mEqClient :: SClientMethod m1 -> SClientMethod m2 -> Maybe (Either (CustomEq m1 m2) (m1 :~~: m2)) Source #
Heterogeneous equality on singleton client methods
Methods
Main LSP method types and functions
data Method f t where Source #
A type representing a LSP method (or class of methods), intended to be used mostly at the type level.
type family MessageParams (m :: Method f t) where ... Source #
Maps a LSP method to its parameter type.
type family MessageResult (m :: Method f t) where ... Source #
Maps a LSP method to its result type.
type family ErrorData (m :: Method f t) where ... Source #
Maps a LSP method to its error data type.
type family RegistrationOptions (m :: Method f t) where ... Source #
Maps a LSP method to its registration options type.
A singleton type for Method
.
Instances
data SomeMethod where Source #
A method which isn't statically known.
SomeMethod :: forall m. SMethod m -> SomeMethod |
Instances
someMethodToMethodString :: SomeMethod -> String Source #
Turn a SomeMethod
into its LSP method string.
methodStringToSomeMethod :: String -> SomeMethod Source #
Turn a LSP method string into a SomeMethod
.
messageDirection :: forall f t (m :: Method f t). SMethod m -> SMessageDirection f Source #
Get a singleton witness for the message direction of a SMethod
.
messageKind :: forall f t (m :: Method f t). SMethod m -> SMessageKind t Source #
Get a singleton witness for the message kind of a SMethod
.
Helpers for working with methods
isOptionalMethod :: SomeMethod -> Bool Source #
Is this an "optional" method which servers and clients are allowed to ignore?
type SClientMethod (m :: Method ClientToServer t) = SMethod m Source #
type SServerMethod (m :: Method ServerToClient t) = SMethod m Source #
data SomeClientMethod Source #
forall t (m :: Method ClientToServer t). SomeClientMethod (SMethod m) |
Instances
FromJSON SomeClientMethod Source # | |
Defined in Language.LSP.Protocol.Message.Method parseJSON :: Value -> Parser SomeClientMethod # parseJSONList :: Value -> Parser [SomeClientMethod] # | |
ToJSON SomeClientMethod Source # | |
Defined in Language.LSP.Protocol.Message.Method toJSON :: SomeClientMethod -> Value # toEncoding :: SomeClientMethod -> Encoding # toJSONList :: [SomeClientMethod] -> Value # toEncodingList :: [SomeClientMethod] -> Encoding # | |
Show SomeClientMethod Source # | |
Defined in Language.LSP.Protocol.Message.Method showsPrec :: Int -> SomeClientMethod -> ShowS # show :: SomeClientMethod -> String # showList :: [SomeClientMethod] -> ShowS # | |
Pretty SomeClientMethod Source # | |
Defined in Language.LSP.Protocol.Message.Method pretty :: SomeClientMethod -> Doc ann # prettyList :: [SomeClientMethod] -> Doc ann # |
data SomeServerMethod Source #
forall t (m :: Method ServerToClient t). SomeServerMethod (SMethod m) |
Instances
FromJSON SomeServerMethod Source # | |
Defined in Language.LSP.Protocol.Message.Method parseJSON :: Value -> Parser SomeServerMethod # parseJSONList :: Value -> Parser [SomeServerMethod] # | |
ToJSON SomeServerMethod Source # | |
Defined in Language.LSP.Protocol.Message.Method toJSON :: SomeServerMethod -> Value # toEncoding :: SomeServerMethod -> Encoding # toJSONList :: [SomeServerMethod] -> Value # toEncodingList :: [SomeServerMethod] -> Encoding # | |
Show SomeServerMethod Source # | |
Defined in Language.LSP.Protocol.Message.Method showsPrec :: Int -> SomeServerMethod -> ShowS # show :: SomeServerMethod -> String # showList :: [SomeServerMethod] -> ShowS # | |
Pretty SomeServerMethod Source # | |
Defined in Language.LSP.Protocol.Message.Method pretty :: SomeServerMethod -> Doc ann # prettyList :: [SomeServerMethod] -> Doc ann # |
someClientMethod :: SMethod m -> Maybe SomeClientMethod Source #
someServerMethod :: SMethod m -> Maybe SomeServerMethod Source #
LSP registrations
data TRegistration (m :: Method ClientToServer t) Source #
Typed registration type, with correct options.
TRegistration | |
|
Instances
regHelper :: forall m x. SMethod m -> (Show (RegistrationOptions m) => ToJSON (RegistrationOptions m) => FromJSON (RegistrationOptions m) => x) -> x Source #
data SomeRegistration Source #
forall t (m :: Method ClientToServer t). SomeRegistration (TRegistration m) |
Instances
FromJSON SomeRegistration Source # | |
Defined in Language.LSP.Protocol.Message.Registration parseJSON :: Value -> Parser SomeRegistration # parseJSONList :: Value -> Parser [SomeRegistration] # | |
ToJSON SomeRegistration Source # | |
Defined in Language.LSP.Protocol.Message.Registration toJSON :: SomeRegistration -> Value # toEncoding :: SomeRegistration -> Encoding # toJSONList :: [SomeRegistration] -> Value # toEncodingList :: [SomeRegistration] -> Encoding # | |
Show SomeRegistration Source # | |
Defined in Language.LSP.Protocol.Message.Registration showsPrec :: Int -> SomeRegistration -> ShowS # show :: SomeRegistration -> String # showList :: [SomeRegistration] -> ShowS # | |
Pretty SomeRegistration Source # | |
Defined in Language.LSP.Protocol.Message.Registration pretty :: SomeRegistration -> Doc ann # prettyList :: [SomeRegistration] -> Doc ann # |
data TUnregistration (m :: Method ClientToServer t) Source #
Typed unregistration type.
Instances
data SomeUnregistration Source #
forall t (m :: Method ClientToServer t). SomeUnregistration (TUnregistration m) |
Instances
FromJSON SomeUnregistration Source # | |
Defined in Language.LSP.Protocol.Message.Registration parseJSON :: Value -> Parser SomeUnregistration # parseJSONList :: Value -> Parser [SomeUnregistration] # | |
ToJSON SomeUnregistration Source # | |
Defined in Language.LSP.Protocol.Message.Registration toJSON :: SomeUnregistration -> Value # toEncoding :: SomeUnregistration -> Encoding # toJSONList :: [SomeUnregistration] -> Value # toEncodingList :: [SomeUnregistration] -> Encoding # | |
Pretty SomeUnregistration Source # | |
Defined in Language.LSP.Protocol.Message.Registration pretty :: SomeUnregistration -> Doc ann # prettyList :: [SomeUnregistration] -> Doc ann # |