@@ -1996,7 +1996,7 @@ suggestImportDisambiguationTests = testGroup "suggest import disambiguation acti
1996
1996
compareHideFunctionTo = compareTwo " HideFunction.hs"
1997
1997
withTarget file locs k = runWithExtraFiles " hiding" $ \ dir -> do
1998
1998
doc <- openDoc file " haskell"
1999
- void $ expectDiagnostics [(file, [(DiagnosticSeverity_Error , loc, " Ambiguous occurrence" ) | loc <- locs])]
1999
+ void $ expectDiagnostics [(file, [(DiagnosticSeverity_Error , loc, " Ambiguous occurrence" , Nothing ) | loc <- locs])] -- TODO: Give this a proper error
2000
2000
actions <- getAllCodeActions doc
2001
2001
k dir doc actions
2002
2002
withHideFunction = withTarget (" HideFunction" <.> " hs" )
@@ -2455,7 +2455,7 @@ deleteUnusedDefinitionTests = testGroup "delete unused definition action"
2455
2455
where
2456
2456
testFor sourceLines pos@ (l,c) expectedTitle expectedLines = do
2457
2457
docId <- createDoc " A.hs" " haskell" $ T. unlines sourceLines
2458
- expectDiagnostics [ (" A.hs" , [(DiagnosticSeverity_Warning , pos, " not used" )]) ]
2458
+ expectDiagnostics [ (" A.hs" , [(DiagnosticSeverity_Warning , pos, " not used" , Nothing )]) ]
2459
2459
action <- pickActionWithTitle expectedTitle =<< getCodeActions docId (R l c l c)
2460
2460
executeCodeAction action
2461
2461
contentAfterAction <- documentContents docId
@@ -2471,8 +2471,8 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
2471
2471
, " f = 1"
2472
2472
]
2473
2473
(if ghcVersion >= GHC94
2474
- then [ (DiagnosticSeverity_Warning , (3 , 4 ), " Defaulting the type variable" ) ]
2475
- else [ (DiagnosticSeverity_Warning , (3 , 4 ), " Defaulting the following constraint" ) ])
2474
+ then [ (DiagnosticSeverity_Warning , (3 , 4 ), " Defaulting the type variable" , Nothing ) ]
2475
+ else [ (DiagnosticSeverity_Warning , (3 , 4 ), " Defaulting the following constraint" , Nothing ) ])
2476
2476
" Add type annotation ‘Integer’ to ‘1’"
2477
2477
[ " {-# OPTIONS_GHC -Wtype-defaults #-}"
2478
2478
, " module A (f) where"
@@ -2490,8 +2490,8 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
2490
2490
, " in x"
2491
2491
]
2492
2492
(if ghcVersion >= GHC94
2493
- then [ (DiagnosticSeverity_Warning , (4 , 12 ), " Defaulting the type variable" ) ]
2494
- else [ (DiagnosticSeverity_Warning , (4 , 12 ), " Defaulting the following constraint" ) ])
2493
+ then [ (DiagnosticSeverity_Warning , (4 , 12 ), " Defaulting the type variable" , Nothing ) ]
2494
+ else [ (DiagnosticSeverity_Warning , (4 , 12 ), " Defaulting the following constraint" , Nothing ) ])
2495
2495
" Add type annotation ‘Integer’ to ‘3’"
2496
2496
[ " {-# OPTIONS_GHC -Wtype-defaults #-}"
2497
2497
, " module A where"
@@ -2510,8 +2510,8 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
2510
2510
, " in x"
2511
2511
]
2512
2512
(if ghcVersion >= GHC94
2513
- then [ (DiagnosticSeverity_Warning , (4 , 20 ), " Defaulting the type variable" ) ]
2514
- else [ (DiagnosticSeverity_Warning , (4 , 20 ), " Defaulting the following constraint" ) ])
2513
+ then [ (DiagnosticSeverity_Warning , (4 , 20 ), " Defaulting the type variable" , Nothing ) ]
2514
+ else [ (DiagnosticSeverity_Warning , (4 , 20 ), " Defaulting the following constraint" , Nothing ) ])
2515
2515
" Add type annotation ‘Integer’ to ‘5’"
2516
2516
[ " {-# OPTIONS_GHC -Wtype-defaults #-}"
2517
2517
, " module A where"
@@ -2532,12 +2532,12 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
2532
2532
]
2533
2533
(if ghcVersion >= GHC94
2534
2534
then
2535
- [ (DiagnosticSeverity_Warning , (6 , 8 ), " Defaulting the type variable" )
2536
- , (DiagnosticSeverity_Warning , (6 , 16 ), " Defaulting the type variable" )
2535
+ [ (DiagnosticSeverity_Warning , (6 , 8 ), " Defaulting the type variable" , Nothing )
2536
+ , (DiagnosticSeverity_Warning , (6 , 16 ), " Defaulting the type variable" , Nothing )
2537
2537
]
2538
2538
else
2539
- [ (DiagnosticSeverity_Warning , (6 , 8 ), " Defaulting the following constraint" )
2540
- , (DiagnosticSeverity_Warning , (6 , 16 ), " Defaulting the following constraint" )
2539
+ [ (DiagnosticSeverity_Warning , (6 , 8 ), " Defaulting the following constraint" , Nothing )
2540
+ , (DiagnosticSeverity_Warning , (6 , 16 ), " Defaulting the following constraint" , Nothing )
2541
2541
])
2542
2542
" Add type annotation ‘String’ to ‘\" debug\" ’"
2543
2543
[ " {-# OPTIONS_GHC -Wtype-defaults #-}"
@@ -2559,8 +2559,8 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
2559
2559
, " f a = traceShow \" debug\" a"
2560
2560
]
2561
2561
(if ghcVersion >= GHC94
2562
- then [ (DiagnosticSeverity_Warning , (6 , 6 ), " Defaulting the type variable" ) ]
2563
- else [ (DiagnosticSeverity_Warning , (6 , 6 ), " Defaulting the following constraint" ) ])
2562
+ then [ (DiagnosticSeverity_Warning , (6 , 6 ), " Defaulting the type variable" , Nothing ) ]
2563
+ else [ (DiagnosticSeverity_Warning , (6 , 6 ), " Defaulting the following constraint" , Nothing ) ])
2564
2564
" Add type annotation ‘String’ to ‘\" debug\" ’"
2565
2565
[ " {-# OPTIONS_GHC -Wtype-defaults #-}"
2566
2566
, " {-# LANGUAGE OverloadedStrings #-}"
@@ -2581,8 +2581,8 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
2581
2581
, " f = seq (\" debug\" :: [Char]) (seq (\" debug\" :: [Char]) (traceShow \" debug\" ))"
2582
2582
]
2583
2583
(if ghcVersion >= GHC94
2584
- then [ (DiagnosticSeverity_Warning , (6 , 54 ), " Defaulting the type variable" ) ]
2585
- else [ (DiagnosticSeverity_Warning , (6 , 54 ), " Defaulting the following constraint" ) ])
2584
+ then [ (DiagnosticSeverity_Warning , (6 , 54 ), " Defaulting the type variable" , Nothing ) ]
2585
+ else [ (DiagnosticSeverity_Warning , (6 , 54 ), " Defaulting the following constraint" , Nothing ) ])
2586
2586
" Add type annotation ‘String’ to ‘\" debug\" ’"
2587
2587
[ " {-# OPTIONS_GHC -Wtype-defaults #-}"
2588
2588
, " {-# LANGUAGE OverloadedStrings #-}"
@@ -2597,7 +2597,7 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
2597
2597
testFor sourceLines diag expectedTitle expectedLines = do
2598
2598
docId <- createDoc " A.hs" " haskell" $ T. unlines sourceLines
2599
2599
expectDiagnostics [ (" A.hs" , diag) ]
2600
- let cursors = map snd3 diag
2600
+ let cursors = map ( \ (_, snd , _, _) -> snd ) diag
2601
2601
(ls, cs) = minimum cursors
2602
2602
(le, ce) = maximum cursors
2603
2603
0 commit comments