Update haskell-lsp to 0.6
authorLuke Lau <luke_lau@icloud.com>
Mon, 6 Aug 2018 14:22:48 +0000 (15:22 +0100)
committerLuke Lau <luke_lau@icloud.com>
Mon, 6 Aug 2018 14:22:48 +0000 (15:22 +0100)
lsp-test.cabal
src/Language/Haskell/LSP/Test.hs
src/Language/Haskell/LSP/Test/Files.hs
stack.yaml

index 2d0b453c76952d909b065ff5fb078ba60c695c39..8c64b50cb71d5cde6af29c7239b42dcacc4c7348 100644 (file)
@@ -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
index 137cbb7a329e93761f6eb792f9043954d145437d..bb4d05721b82b2f43110ff087a6ad7237206b1be 100644 (file)
@@ -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)
 
index deb89e84c06a8b1be92d1c8bdda61e957c4debbd..733a94c160ea94634ef34fc0230ca6f65f4bfe80 100644 (file)
@@ -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) =
index 35cbc75ae464a131ff50c5ec5033b08743ac5ee7..0225de54ad2741a7109aba9d5acbdb0f70ee9de8 100644 (file)
@@ -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