Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1457 from alanz/haskell-lsp-0.18
Browse files Browse the repository at this point in the history
Bump haskell-lsp et al to 0.18.0.0
  • Loading branch information
alanz authored Nov 17, 2019
2 parents 60fae44 + bb7c702 commit 41e4b2a
Show file tree
Hide file tree
Showing 13 changed files with 66 additions and 47 deletions.
10 changes: 5 additions & 5 deletions haskell-ide-engine.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion hie-plugin-api/Haskell/Ide/Engine/PluginUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion hie-plugin-api/hie-plugin-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
45 changes: 32 additions & 13 deletions src/Haskell/Ide/Engine/Transport/LspStdio.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
}


Expand Down
6 changes: 3 additions & 3 deletions stack-8.4.2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions stack-8.4.3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions stack-8.4.4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions stack-8.6.1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions stack-8.6.2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions stack-8.6.3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions stack-8.6.4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions stack-8.6.5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 41e4b2a

Please sign in to comment.