@@ -9,17 +9,16 @@ module Main
9
9
10
10
import Control.Lens ((^.) )
11
11
import Control.Monad (when )
12
- import Data.Aeson (Value (.. ), object , toJSON , (.=) )
12
+ import Data.Aeson (Value (.. ), object , (.=) )
13
13
import Data.Functor (void )
14
14
import Data.List (find )
15
15
import qualified Data.Map as Map
16
16
import Data.Maybe (fromJust , isJust )
17
17
import Data.Row ((.+) , (.==) )
18
18
import qualified Data.Text as T
19
- import Ide.Plugin.Config (Config (.. ), PluginConfig ( .. ) )
19
+ import Ide.Plugin.Config (Config (.. ))
20
20
import qualified Ide.Plugin.Config as Plugin
21
21
import qualified Ide.Plugin.Hlint as HLint
22
- import Ide.Types (PluginId )
23
22
import qualified Language.LSP.Protocol.Lens as L
24
23
import System.FilePath ((</>) )
25
24
import Test.Hls
@@ -383,10 +382,6 @@ data Point = Point {
383
382
column :: ! Int
384
383
}
385
384
386
- makePoint line column
387
- | line >= 1 && column >= 1 = Point line column
388
- | otherwise = error " Line or column is less than 1."
389
-
390
385
pointToRange :: Point -> Range
391
386
pointToRange Point {.. }
392
387
| line <- fromIntegral $ subtract 1 line
@@ -402,10 +397,6 @@ makeCodeActionNotFoundAtString :: Point -> String
402
397
makeCodeActionNotFoundAtString Point {.. } =
403
398
" CodeAction not found at line: " <> show line <> " , column: " <> show column
404
399
405
- makeCodeActionFoundAtString :: Point -> String
406
- makeCodeActionFoundAtString Point {.. } =
407
- " CodeAction found at line: " <> show line <> " , column: " <> show column
408
-
409
400
ignoreHintGoldenTest :: TestName -> FilePath -> Point -> T. Text -> TestTree
410
401
ignoreHintGoldenTest testCaseName goldenFilename point hintName =
411
402
goldenTest testCaseName goldenFilename point (getIgnoreHintText hintName)
@@ -417,7 +408,7 @@ applyHintGoldenTest testCaseName goldenFilename point hintName = do
417
408
goldenTest :: TestName -> FilePath -> Point -> T. Text -> TestTree
418
409
goldenTest testCaseName goldenFilename point hintText =
419
410
setupGoldenHlintTest testCaseName goldenFilename $ \ document -> do
420
- waitForDiagnosticsFromSource document " hlint"
411
+ _ <- waitForDiagnosticsFromSource document " hlint"
421
412
actions <- getCodeActions document $ pointToRange point
422
413
case find ((== Just hintText) . getCodeActionTitle) actions of
423
414
Just (InR codeAction) -> do
@@ -441,7 +432,7 @@ applyHintGoldenResolveTest testCaseName goldenFilename point hintName = do
441
432
goldenResolveTest :: TestName -> FilePath -> Point -> T. Text -> TestTree
442
433
goldenResolveTest testCaseName goldenFilename point hintText =
443
434
setupGoldenHlintResolveTest testCaseName goldenFilename $ \ document -> do
444
- waitForDiagnosticsFromSource document " hlint"
435
+ _ <- waitForDiagnosticsFromSource document " hlint"
445
436
actions <- getAndResolveCodeActions document $ pointToRange point
446
437
case find ((== Just hintText) . getCodeActionTitle) actions of
447
438
Just (InR codeAction) -> executeCodeAction codeAction
0 commit comments