Skip to content

Commit

Permalink
Fix missing script results (#11395)
Browse files Browse the repository at this point in the history
fixes #11007

changelog_begin

- [Daml Studio] Fix a bug where script results in Daml Studio
  sometimes do not show up.

changelog_end
  • Loading branch information
cocreature authored Oct 26, 2021
1 parent 03db0aa commit b1fed31
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bazel-haskell-deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
23 changes: 23 additions & 0 deletions compiler/lsp-tests/src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -64,6 +65,7 @@ main = do
, includePathTests damlcPath
, multiPackageTests damlcPath
, completionTests run runScenarios
, raceTests run
]

conf :: SessionConfig
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit b1fed31

Please sign in to comment.