@@ -282,31 +282,31 @@ typedHoleTests = testGroup "typed hole code actions" [
282
282
_ <- waitForDiagnosticsSource " bios"
283
283
cas <- map (\ (CACodeAction x)-> x) <$> getAllCodeActions doc
284
284
285
- suggestion <-
286
- case ghcVersion of
287
- GHC88 -> do
288
- liftIO $ map ( ^. L. title) cas `matchList`
289
- [ " Substitute hole (Int) with x ([ Int] )"
290
- , " Substitute hole (Int) with foo ([Int] -> Int Valid hole fits include )"
291
- , " Substitute hole (Int) with maxBound (forall a. Bounded a => a with maxBound @Int) "
292
- , " Substitute hole (Int) with minBound (forall a. Bounded a => a with minBound @Int) "
293
- ] @? " Contains substitutions "
294
- return " x "
295
- GHC86 -> do
296
- liftIO $ map ( ^. L. title) cas `matchList`
297
- [ " Substitute hole (Int) with x ([Int]) "
298
- , " Substitute hole (Int) with foo ([Int] -> Int Valid hole fits include) "
299
- , " Substitute hole (Int) with maxBound (forall a. Bounded a => a with maxBound @Int )"
300
- , " Substitute hole (Int) with minBound (forall a. Bounded a => a with minBound @Int )"
301
- ] @? " Contains substitutions "
302
- return " x "
303
- GHC84 -> do
304
- liftIO $ map (^. L. title) cas `matchList`
305
- [ " Substitute hole (Int) with maxBound (forall a. Bounded a => a) "
306
- , " Substitute hole (Int) with minBound (forall a. Bounded a => a) "
307
- , " Substitute hole (Int) with undefined (forall (a :: TYPE r). GHC.Stack.Types.HasCallStack => a) "
308
- ] @? " Contains substitutions "
309
- return " maxBound "
285
+ let substitutions GHC810 = substitutions GHC88
286
+ substitutions GHC88 =
287
+ [ " Substitute hole (Int) with x ([Int]) "
288
+ , " Substitute hole (Int) with foo ([Int] -> Int Valid hole fits include) "
289
+ , " Substitute hole (Int) with maxBound (forall a. Bounded a => a with maxBound @ Int)"
290
+ , " Substitute hole (Int) with minBound (forall a. Bounded a => a with minBound @Int )"
291
+ ]
292
+ substitutions GHC86 =
293
+ [ " Substitute hole (Int) with x ([Int]) "
294
+ , " Substitute hole (Int) with foo ([Int] -> Int Valid hole fits include) "
295
+ , " Substitute hole (Int) with maxBound (forall a. Bounded a => a with maxBound @Int) "
296
+ , " Substitute hole (Int) with minBound (forall a. Bounded a => a with minBound @Int) "
297
+ ]
298
+ substitutions GHC84 =
299
+ [ " Substitute hole (Int) with maxBound (forall a. Bounded a => a)"
300
+ , " Substitute hole (Int) with minBound (forall a. Bounded a => a)"
301
+ , " Substitute hole (Int) with undefined (forall (a :: TYPE r). GHC.Stack.Types.HasCallStack => a) "
302
+ ]
303
+
304
+ liftIO $ map (^. L. title) cas `matchList`
305
+ substitutions ghcVersion @? " Contains substitutions "
306
+
307
+ let suggestion = case ghcVersion of
308
+ GHC84 -> " maxBound "
309
+ _ -> " x "
310
310
311
311
executeCodeAction $ head cas
312
312
@@ -324,30 +324,30 @@ typedHoleTests = testGroup "typed hole code actions" [
324
324
_ <- waitForDiagnosticsSource " bios"
325
325
cas <- map fromAction <$> getAllCodeActions doc
326
326
327
- suggestion <-
328
- case ghcVersion of
329
- GHC88 -> do
330
- liftIO $ map ( ^. L. title) cas `matchList`
331
- [ " Substitute hole (A) with stuff (A -> A)"
332
- , " Substitute hole (A) with x ([A]) "
333
- , " Substitute hole (A) with foo2 ([A] -> A) "
334
- ] @? " Contains substitutions "
335
- return " stuff "
336
- GHC86 -> do
337
- liftIO $ map ( ^. L. title) cas `matchList`
338
- [ " Substitute hole (A) with stuff (A -> A) "
339
- , " Substitute hole (A) with x ([A] )"
340
- , " Substitute hole (A) with foo2 ([A] -> A)"
341
- ] @? " Contains substituions "
342
- return " stuff "
343
- GHC84 -> do
344
- liftIO $ map ( ^. L. title) cas `matchList`
345
- [ " Substitute hole (A) with undefined (forall (a :: TYPE r). GHC.Stack.Types.HasCallStack => a) "
346
- , " Substitute hole (A) with stuff (A -> A) "
347
- , " Substitute hole (A) with x ([A]) "
348
- , " Substitute hole (A) with foo2 ([A] -> A) "
349
- ] @? " Contains substitutions "
350
- return " undefined "
327
+ let substitutions GHC810 = substitutions GHC88
328
+ substitutions GHC88 =
329
+ [ " Substitute hole (A) with stuff (A -> A) "
330
+ , " Substitute hole (A) with x ([A]) "
331
+ , " Substitute hole (A) with foo2 ([A] -> A)"
332
+ ]
333
+ substitutions GHC86 =
334
+ [ " Substitute hole (A) with stuff (A -> A) "
335
+ , " Substitute hole (A) with x ([A]) "
336
+ , " Substitute hole (A) with foo2 ([A] -> A) "
337
+ ]
338
+ substitutions GHC84 =
339
+ [ " Substitute hole (A) with undefined (forall (a :: TYPE r). GHC.Stack.Types.HasCallStack => a )"
340
+ , " Substitute hole (A) with stuff (A -> A)"
341
+ , " Substitute hole (A) with x ([A]) "
342
+ , " Substitute hole (A) with foo2 ([A] -> A) "
343
+ ]
344
+
345
+ liftIO $ map ( ^. L. title) cas `matchList`
346
+ substitutions ghcVersion @? " Contains substitutions "
347
+
348
+ let suggestion = case ghcVersion of
349
+ GHC84 -> " undefined "
350
+ _ -> " stuff "
351
351
352
352
executeCodeAction $ head cas
353
353
0 commit comments