X-Git-Url: https://git.lukelau.me/?p=lsp-test.git;a=blobdiff_plain;f=src%2FLanguage%2FHaskell%2FLSP%2FTest%2FFiles.hs;h=9a54da1f88f0152e5d06ad887635f92e8514ed88;hp=a9e6af624544c9c7cdac377c788a81cb8dcdc5c3;hb=6f3106ce987b2a3794ee7ab444c8bcc204a7b3d2;hpb=8b2c929b82594c3c95a94852a06e9f4a733d40f6 diff --git a/src/Language/Haskell/LSP/Test/Files.hs b/src/Language/Haskell/LSP/Test/Files.hs index a9e6af6..9a54da1 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' (R si) = R (swapUri location <$> si) + swapUri' (L dss) = L 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