@@ -44,7 +44,7 @@ dispatcherSpec = do
44
44
chSync <- atomically newTChan
45
45
let req = IdeRequest " cmd1" (Map. fromList [] )
46
46
cr = CReq " test" 1 req chan
47
- r <- withStdoutLogging $ runIdeM (IdeState Map. empty) (doDispatch (testPlugins chSync) cr)
47
+ r <- withStdoutLogging $ runIdeM (IdeState Map. empty Map. empty ) (doDispatch (testPlugins chSync) cr)
48
48
r `shouldBe` Just (IdeResponseOk (H. fromList [" ok" .= (" result:ctxs=[CtxNone]" :: String )]))
49
49
50
50
-- ---------------------------------
@@ -54,7 +54,7 @@ dispatcherSpec = do
54
54
chSync <- atomically newTChan
55
55
let req = IdeRequest " cmd2" (Map. fromList [] )
56
56
cr = CReq " test" 1 req chan
57
- r <- withStdoutLogging $ runIdeM (IdeState Map. empty) (doDispatch (testPlugins chSync) cr)
57
+ r <- withStdoutLogging $ runIdeM (IdeState Map. empty Map. empty ) (doDispatch (testPlugins chSync) cr)
58
58
r `shouldBe` Just (IdeResponseFail (IdeError {ideCode = MissingParameter , ideMessage = " need `file` parameter" , ideInfo = Just (String " file" )}))
59
59
60
60
-- ---------------------------------
@@ -64,7 +64,7 @@ dispatcherSpec = do
64
64
chSync <- atomically newTChan
65
65
let req = IdeRequest " cmd2" (Map. fromList [(" file" , ParamFileP " foo.hs" )])
66
66
cr = CReq " test" 1 req chan
67
- r <- withStdoutLogging $ runIdeM (IdeState Map. empty) (doDispatch (testPlugins chSync) cr)
67
+ r <- withStdoutLogging $ runIdeM (IdeState Map. empty Map. empty ) (doDispatch (testPlugins chSync) cr)
68
68
r `shouldBe` Just (IdeResponseOk (H. fromList [" ok" .= (" result:ctxs=[CtxFile]" :: String )]))
69
69
70
70
-- ---------------------------------
@@ -74,7 +74,7 @@ dispatcherSpec = do
74
74
chSync <- atomically newTChan
75
75
let req = IdeRequest " cmd3" (Map. fromList [(" file" , ParamFileP " foo.hs" ),(" start_pos" , ParamPosP (1 ,2 ))])
76
76
cr = CReq " test" 1 req chan
77
- r <- withStdoutLogging $ runIdeM (IdeState Map. empty) (doDispatch (testPlugins chSync) cr)
77
+ r <- withStdoutLogging $ runIdeM (IdeState Map. empty Map. empty ) (doDispatch (testPlugins chSync) cr)
78
78
r `shouldBe` Just (IdeResponseOk (H. fromList [" ok" .= (" result:ctxs=[CtxPoint]" :: String )]))
79
79
80
80
-- ---------------------------------
@@ -86,7 +86,7 @@ dispatcherSpec = do
86
86
,(" start_pos" , ParamPosP (1 ,2 ))
87
87
,(" end_pos" , ParamPosP (3 ,4 ))])
88
88
cr = CReq " test" 1 req chan
89
- r <- withStdoutLogging $ runIdeM (IdeState Map. empty) (doDispatch (testPlugins chSync) cr)
89
+ r <- withStdoutLogging $ runIdeM (IdeState Map. empty Map. empty ) (doDispatch (testPlugins chSync) cr)
90
90
r `shouldBe` Just (IdeResponseOk (H. fromList [" ok" .= (" result:ctxs=[CtxRegion]" :: String )]))
91
91
92
92
-- ---------------------------------
@@ -96,7 +96,7 @@ dispatcherSpec = do
96
96
chSync <- atomically newTChan
97
97
let req = IdeRequest " cmd5" (Map. fromList [(" cabal" , ParamTextP " lib" )])
98
98
cr = CReq " test" 1 req chan
99
- r <- withStdoutLogging $ runIdeM (IdeState Map. empty) (doDispatch (testPlugins chSync) cr)
99
+ r <- withStdoutLogging $ runIdeM (IdeState Map. empty Map. empty ) (doDispatch (testPlugins chSync) cr)
100
100
r `shouldBe` Just (IdeResponseOk (H. fromList [" ok" .= (" result:ctxs=[CtxCabalTarget]" :: String )]))
101
101
102
102
@@ -107,7 +107,7 @@ dispatcherSpec = do
107
107
chSync <- atomically newTChan
108
108
let req = IdeRequest " cmd6" (Map. fromList [(" dir" , ParamFileP " ." )])
109
109
cr = CReq " test" 1 req chan
110
- r <- withStdoutLogging $ runIdeM (IdeState Map. empty) (doDispatch (testPlugins chSync) cr)
110
+ r <- withStdoutLogging $ runIdeM (IdeState Map. empty Map. empty ) (doDispatch (testPlugins chSync) cr)
111
111
r `shouldBe` Just (IdeResponseOk (H. fromList [" ok" .= (" result:ctxs=[CtxProject]" :: String )]))
112
112
113
113
-- ---------------------------------
@@ -119,7 +119,7 @@ dispatcherSpec = do
119
119
,(" start_pos" , ParamPosP (1 ,2 ))
120
120
,(" end_pos" , ParamPosP (3 ,4 ))])
121
121
cr = CReq " test" 1 req chan
122
- r <- withStdoutLogging $ runIdeM (IdeState Map. empty) (doDispatch (testPlugins chSync) cr)
122
+ r <- withStdoutLogging $ runIdeM (IdeState Map. empty Map. empty ) (doDispatch (testPlugins chSync) cr)
123
123
r `shouldBe` Just (IdeResponseOk (H. fromList [" ok" .= (" result:ctxs=[CtxFile,CtxPoint,CtxRegion]" :: String )]))
124
124
125
125
-- ---------------------------------
@@ -130,7 +130,7 @@ dispatcherSpec = do
130
130
let req = IdeRequest " cmdmultiple" (Map. fromList [(" file" , ParamFileP " foo.hs" )
131
131
,(" start_pos" , ParamPosP (1 ,2 ))])
132
132
cr = CReq " test" 1 req chan
133
- r <- withStdoutLogging $ runIdeM (IdeState Map. empty) (doDispatch (testPlugins chSync) cr)
133
+ r <- withStdoutLogging $ runIdeM (IdeState Map. empty Map. empty ) (doDispatch (testPlugins chSync) cr)
134
134
r `shouldBe` Just (IdeResponseOk (H. fromList [" ok" .= (" result:ctxs=[CtxFile,CtxPoint]" :: String )]))
135
135
136
136
-- ---------------------------------
@@ -140,7 +140,7 @@ dispatcherSpec = do
140
140
chSync <- atomically newTChan
141
141
let req = IdeRequest " cmdmultiple" (Map. fromList [(" cabal" , ParamTextP " lib" )])
142
142
cr = CReq " test" 1 req chan
143
- r <- withStdoutLogging $ runIdeM (IdeState Map. empty) (doDispatch (testPlugins chSync) cr)
143
+ r <- withStdoutLogging $ runIdeM (IdeState Map. empty Map. empty ) (doDispatch (testPlugins chSync) cr)
144
144
r `shouldBe`
145
145
Just (IdeResponseFail (IdeError { ideCode = MissingParameter
146
146
, ideMessage = " need `file` parameter"
@@ -159,7 +159,7 @@ dispatcherSpec = do
159
159
,(" pos" , ParamPosP (1 ,2 ))
160
160
])
161
161
cr = CReq " test" 1 req chan
162
- r <- withStdoutLogging $ runIdeM (IdeState Map. empty) (doDispatch (testPlugins chSync) cr)
162
+ r <- withStdoutLogging $ runIdeM (IdeState Map. empty Map. empty ) (doDispatch (testPlugins chSync) cr)
163
163
r `shouldBe` Just (IdeResponseOk (H. fromList [" ok" .= (" result:ctxs=[CtxFile]" :: String )]))
164
164
165
165
@@ -174,7 +174,7 @@ dispatcherSpec = do
174
174
,(" pos" , ParamPosP (1 ,2 ))
175
175
])
176
176
cr = CReq " test" 1 req chan
177
- r <- withStdoutLogging $ runIdeM (IdeState Map. empty) (doDispatch (testPlugins chSync) cr)
177
+ r <- withStdoutLogging $ runIdeM (IdeState Map. empty Map. empty ) (doDispatch (testPlugins chSync) cr)
178
178
r `shouldBe`
179
179
Just (IdeResponseFail
180
180
(IdeError
@@ -194,7 +194,7 @@ dispatcherSpec = do
194
194
,(" poso" , ParamPosP (1 ,2 ))
195
195
])
196
196
cr = CReq " test" 1 req chan
197
- r <- withStdoutLogging $ runIdeM (IdeState Map. empty) (doDispatch (testPlugins chSync) cr)
197
+ r <- withStdoutLogging $ runIdeM (IdeState Map. empty Map. empty ) (doDispatch (testPlugins chSync) cr)
198
198
r `shouldBe` Just (IdeResponseOk (H. fromList [" ok" .= (" result:ctxs=[CtxNone]" :: String )]))
199
199
200
200
-- ---------------------------------
@@ -207,7 +207,7 @@ dispatcherSpec = do
207
207
,(" poso" , ParamPosP (1 ,2 ))
208
208
])
209
209
cr = CReq " test" 1 req chan
210
- r <- withStdoutLogging $ runIdeM (IdeState Map. empty) (doDispatch (testPlugins chSync) cr)
210
+ r <- withStdoutLogging $ runIdeM (IdeState Map. empty Map. empty ) (doDispatch (testPlugins chSync) cr)
211
211
r `shouldBe`
212
212
Just (IdeResponseFail
213
213
(IdeError { ideCode = IncorrectParameterType
@@ -229,8 +229,8 @@ dispatcherSpec = do
229
229
req2 = IdeRequest " cmdasync2" Map. empty
230
230
cr1 = CReq " test" 1 req1 chan
231
231
cr2 = CReq " test" 2 req2 chan
232
- r1 <- withStdoutLogging $ runIdeM (IdeState Map. empty) (doDispatch (testPlugins chSync) cr1)
233
- r2 <- withStdoutLogging $ runIdeM (IdeState Map. empty) (doDispatch (testPlugins chSync) cr2)
232
+ r1 <- withStdoutLogging $ runIdeM (IdeState Map. empty Map. empty ) (doDispatch (testPlugins chSync) cr1)
233
+ r2 <- withStdoutLogging $ runIdeM (IdeState Map. empty Map. empty ) (doDispatch (testPlugins chSync) cr2)
234
234
r1 `shouldBe` Nothing
235
235
r2 `shouldBe` Nothing
236
236
rc1 <- atomically $ readTChan chan
0 commit comments