X-Git-Url: https://git.lukelau.me/?a=blobdiff_plain;f=src%2FLanguage%2FHaskell%2FLSP%2FTest%2FFiles.hs;h=693dabd4cd5b0737df11fed53b65bf844c51812a;hb=96f28c37fbc7137415fed9a54927e2da43c72dc8;hp=a9e6af624544c9c7cdac377c788a81cb8dcdc5c3;hpb=98d03792f46f3ac870c010a78944822569e76763;p=lsp-test.git diff --git a/src/Language/Haskell/LSP/Test/Files.hs b/src/Language/Haskell/LSP/Test/Files.hs index a9e6af6..693dabd 100644 --- a/src/Language/Haskell/LSP/Test/Files.hs +++ b/src/Language/Haskell/LSP/Test/Files.hs @@ -1,4 +1,6 @@ {-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE TypeOperators #-} +{-# LANGUAGE DataKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE OverloadedStrings #-} @@ -64,8 +66,9 @@ mapUris f event = fromServerMsg (FromServerMess m@SWorkspaceApplyEdit r) = FromServerMess m $ params . edit .~ swapWorkspaceEdit (r ^. params . edit) $ r fromServerMsg (FromServerMess m@STextDocumentPublishDiagnostics n) = FromServerMess m $ swapUri params n fromServerMsg (FromServerRsp m@STextDocumentDocumentSymbol r) = - let swapUri' (DSSymbolInformation si) = DSSymbolInformation (swapUri location <$> si) - swapUri' (DSDocumentSymbols dss) = DSDocumentSymbols dss -- no file locations here + let swapUri' :: (List DocumentSymbol |? List SymbolInformation) -> List DocumentSymbol |? List SymbolInformation + swapUri' (InR si) = InR (swapUri location <$> si) + swapUri' (InL dss) = InL dss -- no file locations here in FromServerRsp m $ r & result %~ (fmap swapUri') fromServerMsg (FromServerRsp m@STextDocumentRename r) = FromServerRsp m $ r & result %~ (fmap swapWorkspaceEdit) fromServerMsg x = x