@@ -26,13 +26,20 @@ import TestUtils
26
26
27
27
-- ---------------------------------------------------------------------
28
28
29
+ -- | Put a text marker on stdout in the client and the server log
30
+ mark :: String -> Session ()
31
+ mark str = do
32
+ sendNotification (CustomClientMethod " $/testid" ) (T. pack str)
33
+ liftIO $ putStrLn str
34
+
35
+ -- ---------------------------------------------------------------------
36
+
29
37
spec :: Spec
30
38
spec = do
31
39
describe " composes code actions" $
32
40
it " provides 3.8 code actions" $ runSession hieCommandExamplePlugin fullCaps " test/testdata" $ do
33
41
34
- -- sendNotification (CustomClientMethod "$/progress") (T.pack "provides 3.8 code actions")
35
- sendNotification (CustomClientMethod " $/testid" ) (T. pack " provides 3.8 code actions" )
42
+ mark " provides 3.8 code actions"
36
43
37
44
doc <- openDoc " Format.hs" " haskell"
38
45
_diags@ (diag1: _) <- waitForDiagnostics
@@ -54,9 +61,9 @@ spec = do
54
61
55
62
liftIO $ [ca ^. L. title] `shouldContain` [" Add TODO Item 1" ]
56
63
57
- liftIO $ putStrLn $ " A" -- AZ
64
+ mark " A" -- AZ
58
65
executeCodeAction ca
59
- liftIO $ putStrLn $ " B" -- AZ
66
+ mark " B" -- AZ
60
67
61
68
-- _ <- skipMany (message @RegisterCapabilityRequest)
62
69
-- liftIO $ putStrLn $ "B2" -- AZ
@@ -65,7 +72,7 @@ spec = do
65
72
-- liftIO $ putStrLn $ "diags2 = " ++ show _diags2 -- AZ
66
73
67
74
-- contents <- getDocumentEdit doc
68
- liftIO $ putStrLn $ " C" -- AZ
75
+ mark " C" -- AZ
69
76
-- liftIO $ contents `shouldBe` "main = undefined\nfoo x = x\n"
70
77
71
78
-- noDiagnostics
0 commit comments