FromServer t msg -> FromServer t (fromServerMsg msg)
where
- --TODO: Handle all other URLs that might need swapped
+ --TODO: Handle all other URIs that might need swapped
fromClientMsg (NotDidOpenTextDocument n) = NotDidOpenTextDocument $ swapUri (params . textDocument) n
fromClientMsg (NotDidChangeTextDocument n) = NotDidChangeTextDocument $ swapUri (params . textDocument) n
fromClientMsg (NotWillSaveTextDocument n) = NotWillSaveTextDocument $ swapUri (params . textDocument) n
hiding ( error )
import Language.Haskell.LSP.Messages
import qualified Data.HashMap.Strict as HM
-import Debug.Trace
getAllMessages :: Handle -> IO [B.ByteString]
getAllMessages h = do
decodeFromServerMsg :: RequestMap -> B.ByteString -> FromServerMessage
decodeFromServerMsg reqMap bytes =
- case HM.lookup "method" fromJust (decode bytes) of
+ case HM.lookup "method" (fromJust $ decode bytes :: Object) of
Just methodStr -> case fromJSON methodStr of
Success method -> case method of
-- We can work out the type of the message