diff --git a/bazel-haskell-deps.bzl b/bazel-haskell-deps.bzl index e8b3c3ce07bd..df9fd4b48d30 100644 --- a/bazel-haskell-deps.bzl +++ b/bazel-haskell-deps.bzl @@ -17,8 +17,8 @@ load("@os_info//:os_info.bzl", "is_linux", "is_windows") load("@dadew//:dadew.bzl", "dadew_tool_home") load("@rules_haskell//haskell:cabal.bzl", "stack_snapshot") -GHCIDE_REV = "e28a78b9a450fa7970320e78175b8dd382ce0fbd" -GHCIDE_SHA256 = "b038f995c5b71d07b3f0fc973aa0970780bb9ad0365c6552a75ec5264fd3f8a6" +GHCIDE_REV = "2ba61893ea07df26dcacf165a79dd6d0381a3dc8" +GHCIDE_SHA256 = "f3a2fb693d1e6d3beda542639de027a94ae3417fe483765510eceb2ad9ea2b29" JS_JQUERY_VERSION = "3.3.1" JS_DGTABLE_VERSION = "0.5.2" JS_FLOT_VERSION = "0.8.3" diff --git a/compiler/lsp-tests/src/Main.hs b/compiler/lsp-tests/src/Main.hs index 81c596cdd8f6..9b4bdcd5d709 100644 --- a/compiler/lsp-tests/src/Main.hs +++ b/compiler/lsp-tests/src/Main.hs @@ -5,6 +5,7 @@ {-# LANGUAGE TypeOperators #-} module Main (main) where +import Control.Concurrent import Control.Applicative.Combinators import Control.Lens hiding (List, children) import Control.Monad @@ -64,6 +65,7 @@ main = do , includePathTests damlcPath , multiPackageTests damlcPath , completionTests run runScenarios + , raceTests run ] conf :: SessionConfig @@ -1019,6 +1021,27 @@ multiPackageTests damlc ] ] +raceTests + :: (forall a. Session a -> IO a) + -> TestTree +raceTests run = testGroup "race tests" + [ testCaseSteps "race code lens & hover requests" $ \step -> run $ do + main' <- openDoc' "Main.daml" damlId $ T.unlines + [ "module Main where" + , "single : Scenario ()" + , "single = scenario do" + , " assert (True == True)" + ] + lensId <- sendRequest STextDocumentCodeLens (CodeLensParams Nothing Nothing main') + liftIO $ threadDelay (5*1000000) + hoverId <- sendRequest STextDocumentHover (HoverParams main' (Position 2 13) Nothing) + liftIO $ step "waiting for lens response" + _ <- skipManyTill anyMessage (responseForId STextDocumentCodeLens lensId) + liftIO $ step "waiting for hover response" + _ <- skipManyTill anyMessage (responseForId STextDocumentHover hoverId) + closeDoc main' + ] + linkToLocation :: [LocationLink] -> [Location] linkToLocation = map (\LocationLink{_targetUri,_targetRange} -> Location _targetUri _targetRange)