diff --git a/haskell-ide-engine.cabal b/haskell-ide-engine.cabal index 8465147eb..3415552df 100644 --- a/haskell-ide-engine.cabal +++ b/haskell-ide-engine.cabal @@ -71,8 +71,8 @@ library , gitrev >= 1.1 , haddock-api , haddock-library - , haskell-lsp == 0.17.* - , haskell-lsp-types == 0.17.* + , haskell-lsp == 0.18.* + , haskell-lsp-types == 0.18.* , haskell-src-exts , hie-plugin-api , hoogle >= 5.0.13 @@ -196,7 +196,7 @@ test-suite unit-test , free , ghc , haskell-ide-engine - , haskell-lsp-types == 0.17.* + , haskell-lsp-types == 0.18.* , hie-test-utils , hie-plugin-api , hoogle > 5.0.11 @@ -285,8 +285,8 @@ test-suite func-test , filepath , lsp-test >= 0.8.0.0 , haskell-ide-engine - , haskell-lsp-types == 0.17.* - , haskell-lsp == 0.17.* + , haskell-lsp-types == 0.18.* + , haskell-lsp == 0.18.* , hie-test-utils , hie-plugin-api , hspec diff --git a/hie-plugin-api/Haskell/Ide/Engine/PluginUtils.hs b/hie-plugin-api/Haskell/Ide/Engine/PluginUtils.hs index 557ec615a..6d4286948 100644 --- a/hie-plugin-api/Haskell/Ide/Engine/PluginUtils.hs +++ b/hie-plugin-api/Haskell/Ide/Engine/PluginUtils.hs @@ -275,7 +275,7 @@ readVFS :: (MonadIde m, MonadIO m) => Uri -> m (Maybe T.Text) readVFS uri = do mvf <- getVirtualFile uri case mvf of - Just (VirtualFile _ txt _) -> return $ Just (Rope.toText txt) + Just (VirtualFile _ txt) -> return $ Just (Rope.toText txt) Nothing -> return Nothing getRangeFromVFS :: (MonadIde m, MonadIO m) => Uri -> Range -> m (Maybe T.Text) diff --git a/hie-plugin-api/hie-plugin-api.cabal b/hie-plugin-api/hie-plugin-api.cabal index 02759d407..4c496f622 100644 --- a/hie-plugin-api/hie-plugin-api.cabal +++ b/hie-plugin-api/hie-plugin-api.cabal @@ -45,7 +45,7 @@ library , ghc , ghc-mod-core >= 5.9.0.0 , ghc-project-types >= 5.9.0.0 - , haskell-lsp == 0.17.* + , haskell-lsp == 0.18.* , hslogger , monad-control , mtl diff --git a/src/Haskell/Ide/Engine/Transport/LspStdio.hs b/src/Haskell/Ide/Engine/Transport/LspStdio.hs index 52aa4b137..6a6f284c2 100644 --- a/src/Haskell/Ide/Engine/Transport/LspStdio.hs +++ b/src/Haskell/Ide/Engine/Transport/LspStdio.hs @@ -30,6 +30,7 @@ import qualified Data.ByteString.Lazy as BL import Data.Coerce (coerce) import Data.Default import Data.Foldable +import Data.List.NonEmpty ( nonEmpty ) import qualified Data.Map as Map import Data.Maybe import Data.Semigroup (Semigroup(..), Option(..), option) @@ -219,8 +220,8 @@ mapFileFromVfs tn vtdi = do vfsFunc <- asksLspFuncs Core.getVirtualFileFunc mvf <- liftIO $ vfsFunc (J.toNormalizedUri uri) case (mvf, uriToFilePath uri) of - (Just (VFS.VirtualFile _ yitext _), Just fp) -> do - let text' = Rope.toString yitext + (Just (VFS.VirtualFile _ rope), Just fp) -> do + let text' = Rope.toString rope -- text = "{-# LINE 1 \"" ++ fp ++ "\"#-}\n" <> text' let req = GReq tn (Just uri) Nothing Nothing (const $ return ()) $ IdeResultOk <$> do @@ -798,7 +799,7 @@ withDocumentContents reqId uri f = do (J.responseId reqId) J.InvalidRequest "Document was not open" - Just (VFS.VirtualFile _ txt _) -> f (Rope.toText txt) + Just (VFS.VirtualFile _ txt) -> f (Rope.toText txt) -- | Get the currently configured formatter provider. -- The currently configured formatter provider is defined in @Config@ by PluginId. @@ -966,16 +967,34 @@ syncOptions = J.TextDocumentSyncOptions hieOptions :: [T.Text] -> Core.Options hieOptions commandIds = def { Core.textDocumentSync = Just syncOptions - , Core.completionProvider = Just (J.CompletionOptions (Just True) (Just ["."])) - -- As of 2018-05-24, vscode needs the commands to be registered - -- otherwise they will not be available as codeActions (will be - -- silently ignored, despite UI showing to the contrary). - -- - -- Hopefully the end May 2018 vscode release will stabilise - -- this, it is a major rework of the machinery anyway. - , Core.executeCommandProvider = Just (J.ExecuteCommandOptions (J.List commandIds)) - , Core.renameProvider = Just (J.RenameOptions (Just True)) - , Core.implementationProvider = Just (J.GotoOptionsStatic True) + -- The characters that trigger completion automatically. + , Core.completionTriggerCharacters = Just ['.'] + + -- The list of all possible characters that commit a completion. This field can be used + -- if clients don't support individual commmit characters per completion item. See + -- `_commitCharactersSupport`. + -- , completionAllCommitCharacters :: Maybe [Char] + + -- The characters that trigger signature help automatically. + -- , signatureHelpTriggerCharacters :: Maybe [Char] + + -- List of characters that re-trigger signature help. + -- These trigger characters are only active when signature help is already showing. All trigger characters + -- are also counted as re-trigger characters. + -- , signatureHelpRetriggerCharacters :: Maybe [Char] + + -- CodeActionKinds that this server may return. + -- The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server + -- may list out every specific kind they provide. + -- , codeActionKinds :: Maybe [J.CodeActionKind] + + -- The list of characters that triggers on type formatting. + -- If you set `documentOnTypeFormattingHandler`, you **must** set this. + , Core.documentOnTypeFormattingTriggerCharacters = nonEmpty [] + + -- The commands to be executed on the server. + -- If you set `executeCommandHandler`, you **must** set this. + , Core.executeCommandCommands = Just commandIds } diff --git a/stack-8.4.2.yaml b/stack-8.4.2.yaml index f7d20a309..25a572777 100644 --- a/stack-8.4.2.yaml +++ b/stack-8.4.2.yaml @@ -19,14 +19,14 @@ extra-deps: - ghc-lib-parser-8.8.1 - haddock-api-2.20.0 - haddock-library-1.6.0 -- haskell-lsp-0.17.0.0 -- haskell-lsp-types-0.17.0.0 +- haskell-lsp-0.18.0.0 +- haskell-lsp-types-0.18.0.0 - haskell-src-exts-1.21.1 - haskell-src-exts-util-0.2.5 - hlint-2.2.3 - hoogle-5.0.17.11 - hsimport-0.11.0 -- lsp-test-0.8.0.0 +- lsp-test-0.8.2.0 - monad-dijkstra-0.1.1.2 - pretty-show-1.8.2 - rope-utf16-splay-0.3.1.0 diff --git a/stack-8.4.3.yaml b/stack-8.4.3.yaml index 728ba2efd..8b912ef1c 100644 --- a/stack-8.4.3.yaml +++ b/stack-8.4.3.yaml @@ -19,14 +19,14 @@ extra-deps: - ghc-lib-parser-8.8.1 - haddock-api-2.20.0 - haddock-library-1.6.0 -- haskell-lsp-0.17.0.0 -- haskell-lsp-types-0.17.0.0 +- haskell-lsp-0.18.0.0 +- haskell-lsp-types-0.18.0.0 - haskell-src-exts-1.21.1 - haskell-src-exts-util-0.2.5 - hlint-2.2.3 - hoogle-5.0.17.11 - hsimport-0.11.0 -- lsp-test-0.8.0.0 +- lsp-test-0.8.2.0 - monad-dijkstra-0.1.1.2 - pretty-show-1.8.2 - rope-utf16-splay-0.3.1.0 diff --git a/stack-8.4.4.yaml b/stack-8.4.4.yaml index 05258f8d0..b820d620c 100644 --- a/stack-8.4.4.yaml +++ b/stack-8.4.4.yaml @@ -18,14 +18,14 @@ extra-deps: - ghc-lib-parser-8.8.1 - haddock-api-2.20.0 - haddock-library-1.6.0 -- haskell-lsp-0.17.0.0 -- haskell-lsp-types-0.17.0.0 +- haskell-lsp-0.18.0.0 +- haskell-lsp-types-0.18.0.0 - haskell-src-exts-1.21.1 - haskell-src-exts-util-0.2.5 - hlint-2.2.3 - hoogle-5.0.17.11 - hsimport-0.11.0 -- lsp-test-0.8.0.0 +- lsp-test-0.8.2.0 - monad-dijkstra-0.1.1.2 - optparse-simple-0.1.0 - pretty-show-1.9.5 diff --git a/stack-8.6.1.yaml b/stack-8.6.1.yaml index 08b24e7be..be46a7c88 100644 --- a/stack-8.6.1.yaml +++ b/stack-8.6.1.yaml @@ -22,14 +22,14 @@ extra-deps: - floskell-0.10.1 - ghc-lib-parser-8.8.1 - haddock-api-2.21.0 -- haskell-lsp-0.17.0.0 -- haskell-lsp-types-0.17.0.0 +- haskell-lsp-0.18.0.0 +- haskell-lsp-types-0.18.0.0 - haskell-src-exts-1.21.1 - haskell-src-exts-util-0.2.5 - hlint-2.2.3 - hoogle-5.0.17.11 - hsimport-0.11.0 -- lsp-test-0.8.0.0 +- lsp-test-0.8.2.0 - monad-dijkstra-0.1.1.2 - monad-memo-0.4.1 - monoid-subclasses-0.4.6.1 diff --git a/stack-8.6.2.yaml b/stack-8.6.2.yaml index 8228d8591..87bb2c771 100644 --- a/stack-8.6.2.yaml +++ b/stack-8.6.2.yaml @@ -18,14 +18,14 @@ extra-deps: - floskell-0.10.1 - ghc-lib-parser-8.8.1 - haddock-api-2.21.0 -- haskell-lsp-0.17.0.0 -- haskell-lsp-types-0.17.0.0 +- haskell-lsp-0.18.0.0 +- haskell-lsp-types-0.18.0.0 - haskell-src-exts-1.21.1 - haskell-src-exts-util-0.2.5 - hlint-2.2.3 - hoogle-5.0.17.11 - hsimport-0.11.0 -- lsp-test-0.8.0.0 +- lsp-test-0.8.2.0 - monad-dijkstra-0.1.1.2 - monad-memo-0.4.1 - multistate-0.8.0.1 diff --git a/stack-8.6.3.yaml b/stack-8.6.3.yaml index a7d8a85c2..c980dc1b4 100644 --- a/stack-8.6.3.yaml +++ b/stack-8.6.3.yaml @@ -17,14 +17,14 @@ extra-deps: - floskell-0.10.1 - ghc-lib-parser-8.8.1 - haddock-api-2.21.0 -- haskell-lsp-0.17.0.0 -- haskell-lsp-types-0.17.0.0 +- haskell-lsp-0.18.0.0 +- haskell-lsp-types-0.18.0.0 - haskell-src-exts-1.21.1 - haskell-src-exts-util-0.2.5 - hlint-2.2.3 - hoogle-5.0.17.11 - hsimport-0.11.0 -- lsp-test-0.8.0.0 +- lsp-test-0.8.2.0 - monad-dijkstra-0.1.1.2 - monad-memo-0.4.1 - multistate-0.8.0.1 diff --git a/stack-8.6.4.yaml b/stack-8.6.4.yaml index adea017a2..521474b0e 100644 --- a/stack-8.6.4.yaml +++ b/stack-8.6.4.yaml @@ -17,13 +17,13 @@ extra-deps: - floskell-0.10.1 - ghc-lib-parser-8.8.1 - haddock-api-2.22.0 -- haskell-lsp-0.17.0.0 -- haskell-lsp-types-0.17.0.0 +- haskell-lsp-0.18.0.0 +- haskell-lsp-types-0.18.0.0 - haskell-src-exts-1.21.1 - hlint-2.2.3 - hoogle-5.0.17.11 - hsimport-0.11.0 -- lsp-test-0.8.0.0 +- lsp-test-0.8.2.0 - monad-dijkstra-0.1.1.2@rev:1 - monad-memo-0.4.1 - multistate-0.8.0.1 diff --git a/stack-8.6.5.yaml b/stack-8.6.5.yaml index 3bf0af29f..73e7a010b 100644 --- a/stack-8.6.5.yaml +++ b/stack-8.6.5.yaml @@ -18,12 +18,12 @@ extra-deps: - floskell-0.10.1 - ghc-lib-parser-8.8.1 - haddock-api-2.22.0 -- haskell-lsp-0.17.0.0 -- haskell-lsp-types-0.17.0.0 +- haskell-lsp-0.18.0.0 +- haskell-lsp-types-0.18.0.0 - hlint-2.2.3 - hsimport-0.11.0 - hoogle-5.0.17.11 -- lsp-test-0.8.0.0 +- lsp-test-0.8.2.0 - monad-dijkstra-0.1.1.2@rev:1 - syz-0.2.0.0 - temporary-1.2.1.1 diff --git a/stack.yaml b/stack.yaml index 0acbf41fa..37fc5655d 100644 --- a/stack.yaml +++ b/stack.yaml @@ -18,11 +18,11 @@ extra-deps: - floskell-0.10.1 - ghc-lib-parser-8.8.1 - haddock-api-2.22.0 -- haskell-lsp-0.17.0.0 -- haskell-lsp-types-0.17.0.0 +- haskell-lsp-0.18.0.0 +- haskell-lsp-types-0.18.0.0 - hlint-2.2.3 - hsimport-0.11.0 -- lsp-test-0.8.0.0 +- lsp-test-0.8.2.0 - monad-dijkstra-0.1.1.2@rev:1 - syz-0.2.0.0 - temporary-1.2.1.1