@@ -9,6 +9,7 @@ import Control.Monad
9
9
import Data.Aeson
10
10
import qualified Data.HashMap.Strict as HM
11
11
import Data.List
12
+ import qualified Data.Map as M
12
13
import Data.Maybe
13
14
import qualified Data.Text as T
14
15
import Ide.Plugin.Config
@@ -400,9 +401,9 @@ redundantImportTests = testGroup "redundant import code actions" [
400
401
401
402
typedHoleTests :: TestTree
402
403
typedHoleTests = testGroup " typed hole code actions" [
403
- ignoreTestBecause " Wingman changes the result of this test when enabled" $
404
404
testCase " works" $
405
405
runSession hlsCommand fullCaps " test/testdata" $ do
406
+ disableWingman
406
407
doc <- openDoc " TypedHoles.hs" " haskell"
407
408
_ <- waitForDiagnosticsFromSource doc " typecheck"
408
409
cas <- getAllCodeActions doc
@@ -421,9 +422,9 @@ typedHoleTests = testGroup "typed hole code actions" [
421
422
, " foo x = maxBound"
422
423
]
423
424
424
- , ignoreTestBecause " Wingman changes the result of this test when enabled" $
425
- testCase " shows more suggestions" $
425
+ , testCase " shows more suggestions" $
426
426
runSession hlsCommand fullCaps " test/testdata" $ do
427
+ disableWingman
427
428
doc <- openDoc " TypedHoles2.hs" " haskell"
428
429
_ <- waitForDiagnosticsFromSource doc " typecheck"
429
430
cas <- getAllCodeActions doc
@@ -525,6 +526,17 @@ unusedTermTests = testGroup "unused term code actions" [
525
526
all (Just CodeActionRefactorInline == ) kinds @? " All CodeActionRefactorInline"
526
527
]
527
528
529
+ disableWingman :: Session ()
530
+ disableWingman =
531
+ sendConfigurationChanged $ def
532
+ { plugins = M. fromList [ (" tactics" , def { plcGlobalOn = False }) ]
533
+ }
534
+
535
+
536
+ sendConfigurationChanged :: Config -> Session ()
537
+ sendConfigurationChanged config =
538
+ sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config))
539
+
528
540
noLiteralCaps :: C. ClientCapabilities
529
541
noLiteralCaps = def { C. _textDocument = Just textDocumentCaps }
530
542
where
0 commit comments