Skip to content

Commit

Permalink
Upgrade haskell-lsp and lsp-test (digital-asset#2474)
Browse files Browse the repository at this point in the history
* Upgrade haskell-lsp and lsp-test

There have been some fixes upstream that should hopefully mean that we
no longer need to mark the lsp-tests as flaky on Windows. I am having
trouble reproducing the flakiness locally, so let’s see what happens
on CI.

* Also bump stack.yaml
  • Loading branch information
cocreature authored Aug 9, 2019
1 parent 3c03d8c commit d388c56
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 19 deletions.
20 changes: 11 additions & 9 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,9 @@ load("@bazel_skylib//lib:dicts.bzl", "dicts")
# For the time being we build with GMP. See https://github.com/digital-asset/daml/issues/106
use_integer_simple = not is_windows

HASKELL_LSP_COMMIT = "d73e2ccb518724e6766833ee3d7e73289cbe0018"
HASKELL_LSP_COMMIT = "bfbd8630504ebc57b70948689c37b85cfbe589da"

HASKELL_LSP_HASH = "36b92431039e6289eb709b8872f5010a57d4a45e637e1c1c945bdb3128586081"
HASKELL_LSP_HASH = "a301d9409c3a19a042bdf5763611c6a60af5cbc1ff0f281acbc19b3ee70dde5f"

GHC_LIB_VERSION = "8.8.0.20190730.1"

Expand Down Expand Up @@ -541,8 +541,6 @@ hazel_repositories(
) +
hazel_hackage("terminal-progress-bar", "0.4.1", "a61ca10c92cacc712dbbe28881dc23f41cc139760b7b2eef66bd0faa60ea5e24") +
hazel_hackage("rope-utf16-splay", "0.3.1.0", "cbf878098355441ed7be445466fcb72d45390073a298b37649d762de2a7f8cc6") +
# This corresponds to our normalize-uri branch that enforces a consistent
# precent-encoding for URIs used as keys.
hazel_github_external(
"alanz",
"haskell-lsp",
Expand All @@ -557,12 +555,16 @@ hazel_repositories(
name = "haskell-lsp-types",
directory = "/haskell-lsp-types/",
) +
# This corresponds to our custom-methods branch which makes
# lsp-test work with the custom methods changes in haskell-lsp.
hazel_github(
# lsp-test’s cabal file relies on haskell-lsp reexporting haskell-lsp-types.
# Hazel does not handle that for now, so we patch the cabal file
# to add an explicit dependency on haskell-lsp-types.
hazel_github_external(
"bubba",
"lsp-test",
"50c43452e19e494d71ccba1f7922d0b3b3fc69c3",
"65a56b35ddc8fa4deab10ac42efcdcbd36e875b715bb504d10b020a1e5fffd2c",
"d126623dc6895d325e3d204d74e2a22d4f515587",
"a2be2d812010eaadd4885fb0228370a5467627bbb6bd43177fd1f6e5a7eb05f8",
patch_args = ["-p1"],
patches = ["@com_github_digital_asset_daml//bazel_tools:haskell-lsp-test-no-reexport.patch"],
) +
hazel_github_external(
"mpickering",
Expand Down
12 changes: 12 additions & 0 deletions bazel_tools/haskell-lsp-test-no-reexport.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/lsp-test.cabal b/lsp-test.cabal
index 1c8350a..4d96585 100644
--- a/lsp-test.cabal
+++ b/lsp-test.cabal
@@ -37,6 +37,7 @@ library
default-language: Haskell2010
build-depends: base >= 4.10 && < 5
, haskell-lsp == 0.15.*
+ , haskell-lsp-types
, aeson
, aeson-pretty
, ansi-terminal
10 changes: 7 additions & 3 deletions compiler/hie-core/src/Development/IDE/LSP/LanguageServer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,17 @@ runLanguageServer options userHandlers getIdeState = do
-- out of order to be useful. Existing handlers are run afterwards.
handlers <- parts WithMessage{withResponse, withNotification} def

let initializeCallbacks = LSP.InitializeCallbacks
{ LSP.onInitialConfiguration = const $ Right ()
, LSP.onConfigurationChange = const $ Right ()
, LSP.onStartup = handleInit (signalBarrier clientMsgBarrier ()) clearReqId waitForCancel clientMsgChan
}

void $ waitAnyCancel =<< traverse async
[ void $ LSP.runWithHandles
stdin
newStdout
( const $ Right ()
, handleInit (signalBarrier clientMsgBarrier ()) clearReqId waitForCancel clientMsgChan
)
initializeCallbacks
handlers
(modifyOptions options)
Nothing
Expand Down
6 changes: 3 additions & 3 deletions compiler/hie-core/stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ packages:

extra-deps:
- git: https://github.com/alanz/haskell-lsp.git
commit: d73e2ccb518724e6766833ee3d7e73289cbe0018
commit: bfbd8630504ebc57b70948689c37b85cfbe589da
subdirs:
- .
- haskell-lsp-types
- git: https://github.com/digital-asset/lsp-test.git
commit: 50c43452e19e494d71ccba1f7922d0b3b3fc69c3
- git: https://github.com/bubba/lsp-test.git
commit: d126623dc6895d325e3d204d74e2a22d4f515587
- git: https://github.com/mpickering/hie-bios.git
commit: 8427e424a83c2f3d60bdd26c02478c00d2189a73
nix:
Expand Down
4 changes: 0 additions & 4 deletions compiler/lsp-tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ da_haskell_test(
data = [
"//compiler/damlc",
],
# For some reason this test sometimes seems to time out on Windows.
# It hits the Bazel timeout rather than the timeout in lsp-tests
# so it looks like it locks up somehow.
flaky = is_windows,
hazel_deps = [
"aeson",
"base",
Expand Down

0 comments on commit d388c56

Please sign in to comment.