--- /dev/null
+packages:
+ ./.
+source-repository-package
+ type: git
+ location: https://github.com/alanz/haskell-lsp.git
+ tag: 491d8d2e33572b3868078f57a3375b2ac621f958
+source-repository-package
+ type: git
+ location: https://github.com/alanz/haskell-lsp.git
+ tag: 491d8d2e33572b3868078f57a3375b2ac621f958
+ subdir: haskell-lsp-types
decodeFromServerMsg :: RequestMap -> B.ByteString -> FromServerMessage
decodeFromServerMsg reqMap bytes =
- case HM.lookup "method" (fromJust $ decode bytes :: Object) of
+ case HM.lookup "method" obj of
Just methodStr -> case fromJSON methodStr of
Success method -> case method of
-- We can work out the type of the message
WorkspaceApplyEdit -> ReqApplyWorkspaceEdit $ fromJust $ decode bytes
WorkspaceWorkspaceFolders -> error "ReqWorkspaceFolders not supported yet"
WorkspaceConfiguration -> error "ReqWorkspaceConfiguration not supported yet"
+ CustomServerMethod _
+ | "id" `HM.member` obj && "method" `HM.member` obj -> ReqCustomServer $ fromJust $ decode bytes
+ | "id" `HM.member` obj -> RspCustomServer $ fromJust $ decode bytes
+ | otherwise -> NotCustomServer $ fromJust $ decode bytes
Error e -> error e
Just req -> matchResponseMsgType req bytes -- try to decode it to more specific type
Nothing -> error "Couldn't match up response with request"
Nothing -> error "Couldn't decode message"
+ where obj = fromJust $ decode bytes :: Object
(ReqApplyWorkspaceEdit m) -> request m
(ReqShowMessage m) -> request m
(ReqUnregisterCapability m) -> request m
+ (ReqCustomServer m) -> request m
(RspInitialize m) -> response m
(RspShutdown m) -> response m
(RspHover m) -> response m
(RspDocumentColor m) -> response m
(RspColorPresentation m) -> response m
(RspFoldingRange m) -> response m
+ (RspCustomServer m) -> response m
(NotPublishDiagnostics m) -> notification m
(NotLogMessage m) -> notification m
(NotShowMessage m) -> notification m
(NotProgressDone m) -> notification m
(NotTelemetry m) -> notification m
(NotCancelRequestFromServer m) -> notification m
+ (NotCustomServer m) -> notification m
handleClientMessage
:: forall a.
(NotDidChangeWatchedFiles m) -> notification m
(NotDidChangeWorkspaceFolders m) -> notification m
(NotProgressCancel m) -> notification m
- (UnknownFromClientMessage m) -> error $ "Unknown message sent from client: " ++ show m
+ (ReqCustomClient m) -> request m
+ (NotCustomClient m) -> notification m
- .
extra-deps:
- - haskell-lsp-0.13.0.0
- - haskell-lsp-types-0.13.0.0
+ - git: https://github.com/alanz/haskell-lsp.git
+ commit: 491d8d2e33572b3868078f57a3375b2ac621f958
+ subdirs:
+ - .
+ - haskell-lsp-types
- rope-utf16-splay-0.3.1.0