@@ -25,6 +25,8 @@ import Wingman.LanguageServer.TacticProviders
25
25
import Wingman.Machinery (runTactic , scoreSolution )
26
26
import Wingman.Range
27
27
import Wingman.Types
28
+ import Development.IDE.Core.Service (getIdeOptionsIO )
29
+ import Development.IDE.Types.Options (IdeTesting (IdeTesting ), IdeOptions (IdeOptions , optTesting ))
28
30
29
31
30
32
------------------------------------------------------------------------------
@@ -34,7 +36,7 @@ makeTacticInteraction
34
36
-> Interaction
35
37
makeTacticInteraction cmd =
36
38
Interaction $ Continuation @ _ @ HoleTarget cmd
37
- (SynthesizeCodeAction $ \ env@ LspEnv { .. } hj -> do
39
+ (SynthesizeCodeAction $ \ env hj -> do
38
40
pure $ commandProvider cmd $
39
41
TacticProviderData
40
42
{ tpd_lspEnv = env
@@ -48,9 +50,13 @@ makeTacticInteraction cmd =
48
50
let span = fmap (rangeToRealSrcSpan (fromNormalizedFilePath fc_nfp)) hj_range
49
51
TrackedStale _ pmmap <- mapMaybeT liftIO $ stale GetAnnotatedParsedSource
50
52
pm_span <- liftMaybe $ mapAgeFrom pmmap span
53
+ IdeOptions {optTesting = IdeTesting isTesting} <-
54
+ liftIO $ getIdeOptionsIO (shakeExtras le_ideState)
55
+
51
56
let t = commandTactic cmd var_name
57
+ timeout = if isTesting then maxBound else cfg_timeout_seconds le_config * seconds
52
58
53
- liftIO $ runTactic (cfg_timeout_seconds le_config * seconds) hj_ctx hj_jdg t >>= \ case
59
+ liftIO $ runTactic timeout hj_ctx hj_jdg t >>= \ case
54
60
Left err ->
55
61
pure
56
62
$ pure
0 commit comments