@@ -7,6 +7,7 @@ module Main
7
7
) where
8
8
9
9
import Control.Lens ((^.) )
10
+ import Control.Monad (when )
10
11
import Data.Aeson (Value (.. ), object , toJSON , (.=) )
11
12
import Data.Functor (void )
12
13
import Data.List (find )
@@ -398,7 +399,7 @@ ignoreHintGoldenTest testCaseName goldenFilename point hintName =
398
399
goldenTest testCaseName goldenFilename point (getIgnoreHintText hintName)
399
400
400
401
applyHintGoldenTest :: TestName -> FilePath -> Point -> T. Text -> TestTree
401
- applyHintGoldenTest testCaseName goldenFilename point hintName =
402
+ applyHintGoldenTest testCaseName goldenFilename point hintName = do
402
403
goldenTest testCaseName goldenFilename point (getApplyHintText hintName)
403
404
404
405
goldenTest :: TestName -> FilePath -> Point -> T. Text -> TestTree
@@ -409,7 +410,8 @@ goldenTest testCaseName goldenFilename point hintText =
409
410
case find ((== Just hintText) . getCodeActionTitle) actions of
410
411
Just (InR codeAction) -> do
411
412
executeCodeAction codeAction
412
- void $ skipManyTill anyMessage $ getDocumentEdit document
413
+ when (isJust (codeAction ^. L. command)) $
414
+ void $ skipManyTill anyMessage $ getDocumentEdit document
413
415
_ -> liftIO $ assertFailure $ makeCodeActionNotFoundAtString point
414
416
415
417
setupGoldenHlintTest :: TestName -> FilePath -> (TextDocumentIdentifier -> Session () ) -> TestTree
0 commit comments