From: Luke Lau Date: Mon, 6 Aug 2018 14:22:48 +0000 (+0100) Subject: Update haskell-lsp to 0.6 X-Git-Url: http://git.lukelau.me/?p=opengl.git;a=commitdiff_plain;h=4c5ad9975b44f2a0482d98c1e67f2de78e7dd0ca Update haskell-lsp to 0.6 --- diff --git a/lsp-test.cabal b/lsp-test.cabal index 2d0b453..8c64b50 100644 --- a/lsp-test.cabal +++ b/lsp-test.cabal @@ -35,7 +35,7 @@ library , parser-combinators:Control.Applicative.Combinators default-language: Haskell2010 build-depends: base >= 4.7 && < 5 - , haskell-lsp >= 0.5 + , haskell-lsp >= 0.6 , aeson , aeson-pretty , ansi-terminal @@ -78,7 +78,7 @@ test-suite tests , hspec , lens , data-default - , haskell-lsp >= 0.5 + , haskell-lsp >= 0.6 , lsp-test , aeson , unordered-containers diff --git a/src/Language/Haskell/LSP/Test.hs b/src/Language/Haskell/LSP/Test.hs index 137cbb7..bb4d057 100644 --- a/src/Language/Haskell/LSP/Test.hs +++ b/src/Language/Haskell/LSP/Test.hs @@ -359,7 +359,7 @@ getDocumentSymbols doc = do -- | Returns all the code actions in a document by -- querying the code actions at each of the current -- diagnostics' positions. -getAllCodeActions :: TextDocumentIdentifier -> Session [CommandOrCodeAction] +getAllCodeActions :: TextDocumentIdentifier -> Session [CAResult] getAllCodeActions doc = do curDiags <- fromMaybe [] . Map.lookup (doc ^. uri) . curDiagnostics <$> get let ctx = CodeActionContext (List curDiags) Nothing @@ -367,7 +367,7 @@ getAllCodeActions doc = do foldM (go ctx) [] curDiags where - go :: CodeActionContext -> [CommandOrCodeAction] -> Diagnostic -> Session [CommandOrCodeAction] + go :: CodeActionContext -> [CAResult] -> Diagnostic -> Session [CAResult] go ctx acc diag = do ResponseMessage _ rspLid mRes mErr <- request TextDocumentCodeAction (CodeActionParams doc (diag ^. range) ctx) diff --git a/src/Language/Haskell/LSP/Test/Files.hs b/src/Language/Haskell/LSP/Test/Files.hs index deb89e8..733a94c 100644 --- a/src/Language/Haskell/LSP/Test/Files.hs +++ b/src/Language/Haskell/LSP/Test/Files.hs @@ -62,7 +62,9 @@ mapUris f event = 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) = diff --git a/stack.yaml b/stack.yaml index 35cbc75..0225de5 100644 --- a/stack.yaml +++ b/stack.yaml @@ -3,5 +3,5 @@ packages: - . extra-deps: - - haskell-lsp-0.5.0.0 - - haskell-lsp-types-0.5.0.0 + - haskell-lsp-0.6.0.0 + - haskell-lsp-types-0.6.0.0