where
import Language.Haskell.LSP.Capture
-import Language.Haskell.LSP.Types hiding ( error )
+import Language.Haskell.LSP.Types
+import Language.Haskell.LSP.Types.Lens hiding (error)
import Language.Haskell.LSP.Messages
import Control.Lens
import qualified Data.HashMap.Strict as HM
fromClientMsg (NotWillSaveTextDocument n) = NotWillSaveTextDocument $ swapUri (params . textDocument) n
fromClientMsg (NotDidSaveTextDocument n) = NotDidSaveTextDocument $ swapUri (params . textDocument) n
fromClientMsg (NotDidCloseTextDocument n) = NotDidCloseTextDocument $ swapUri (params . textDocument) n
- fromClientMsg (ReqInitialize r) = ReqInitialize $ params .~ (transformInit (r ^. params)) $ r
+ fromClientMsg (ReqInitialize r) = ReqInitialize $ params .~ transformInit (r ^. params) $ r
fromClientMsg (ReqDocumentSymbols r) = ReqDocumentSymbols $ swapUri (params . textDocument) r
fromClientMsg (ReqRename r) = ReqRename $ swapUri (params . textDocument) r
fromClientMsg x = x
fromServerMsg (NotPublishDiagnostics n) = NotPublishDiagnostics $ swapUri params n
fromServerMsg (RspDocumentSymbols r) =
- let newSymbols = fmap (fmap (swapUri location)) $ r ^. result
+ let newSymbols = case r ^. result of
+ Just (DSSymbolInformation si) -> Just (DSSymbolInformation (fmap (swapUri location) si))
+ x -> x
in RspDocumentSymbols $ result .~ newSymbols $ r
fromServerMsg (RspRename r) =