@@ -36,7 +36,7 @@ tests recorder = testGroup
3636 " class"
3737 [codeActionTests recorder , codeLensTests recorder]
3838
39- -- codeActionTests :: TestTree
39+ codeActionTests :: Recorder ( WithPriority Class. Log ) -> TestTree
4040codeActionTests recorder = testGroup
4141 " code actions"
4242 [ testCase " Produces addMinimalMethodPlaceholders code actions for one instance" $ do
@@ -70,22 +70,22 @@ codeActionTests recorder = testGroup
7070 , goldenWithClass recorder " Creates a placeholder for other two methods" " T6" " 2" $ \ (_: _: ghAction: _) -> do
7171 executeCodeAction ghAction
7272 , onlyRunForGhcVersions [GHC92 ] " Only ghc-9.2 enabled GHC2021 implicitly" $
73- goldenWithClass recorder " Don't insert pragma with GHC2021" " T16 " " " $ \ (_: eqWithSig: _) -> do
73+ goldenWithClass recorder " Don't insert pragma with GHC2021" " InsertWithGHC2021Enabled " " " $ \ (_: eqWithSig: _) -> do
7474 executeCodeAction eqWithSig
75- , goldenWithClass recorder " Insert pragma if not exist" " T7 " " " $ \ (_: eqWithSig: _) -> do
75+ , goldenWithClass recorder " Insert pragma if not exist" " InsertWithoutPragma " " " $ \ (_: eqWithSig: _) -> do
7676 executeCodeAction eqWithSig
77- , goldenWithClass recorder " Don't insert pragma if exist" " T8 " " " $ \ (_: eqWithSig: _) -> do
77+ , goldenWithClass recorder " Don't insert pragma if exist" " InsertWithPragma " " " $ \ (_: eqWithSig: _) -> do
7878 executeCodeAction eqWithSig
79- , goldenWithClass recorder " Only insert pragma once" " T9 " " " $ \ (_: multi: _) -> do
79+ , goldenWithClass recorder " Only insert pragma once" " InsertPragmaOnce " " " $ \ (_: multi: _) -> do
8080 executeCodeAction multi
8181 ]
8282
83- -- codeLensTests :: TestTree
83+ codeLensTests :: Recorder ( WithPriority Class. Log ) -> TestTree
8484codeLensTests recorder = testGroup
8585 " code lens"
8686 [ testCase " Has code lens" $ do
8787 runSessionWithServer (classPlugin recorder) testDataDir $ do
88- doc <- openDoc " T10 .hs" " haskell"
88+ doc <- openDoc " CodeLensSimple .hs" " haskell"
8989 lens <- getCodeLenses doc
9090 let titles = map (^. J. title) $ mapMaybe (^. J. command) lens
9191 liftIO $ titles @?=
@@ -97,25 +97,27 @@ codeLensTests recorder = testGroup
9797 sendConfigurationChanged
9898 $ toJSON
9999 $ def { Plugin. plugins = [(" class" , def { plcConfig = " typelensOn" .= False })] }
100- doc <- openDoc " T10 .hs" " haskell"
100+ doc <- openDoc " CodeLensSimple .hs" " haskell"
101101 lens <- getCodeLenses doc
102102 let titles = map (^. J. title) $ mapMaybe (^. J. command) lens
103103 liftIO $ titles @?= []
104- , goldenCodeLens recorder " Apply code lens" " T10 " 1
105- , goldenCodeLens recorder " Apply code lens for local class" " T11 " 0
106- , goldenCodeLens recorder " Apply code lens on the same line" " T12 " 0
107- , goldenCodeLens recorder " Don't insert pragma while existing" " T13 " 0
104+ , goldenCodeLens recorder " Apply code lens" " CodeLensSimple " 1
105+ , goldenCodeLens recorder " Apply code lens for local class" " LocalClassDefine " 0
106+ , goldenCodeLens recorder " Apply code lens on the same line" " Inline " 0
107+ , goldenCodeLens recorder " Don't insert pragma while existing" " CodeLensWithPragma " 0
108108 , onlyRunForGhcVersions [GHC92 ] " Only ghc-9.2 enabled GHC2021 implicitly" $
109- goldenCodeLens recorder " Don't insert pragma while GHC2021 enabled" " T14" 0
110- , goldenCodeLens recorder " Qualified name" " T15" 0
109+ goldenCodeLens recorder " Don't insert pragma while GHC2021 enabled" " CodeLensWithGHC2021" 0
110+ , goldenCodeLens recorder " Qualified name" " Qualified" 0
111+ , goldenCodeLens recorder " Type family" " TypeFamily" 0
111112 ]
112113
113114_CACodeAction :: Prism' (Command |? CodeAction ) CodeAction
114115_CACodeAction = prism' InR $ \ case
115116 InR action -> Just action
116117 _ -> Nothing
117118
118- -- goldenCodeLens :: TestName -> FilePath -> Int -> TestTree
119+
120+ goldenCodeLens :: Recorder (WithPriority Class. Log ) -> TestName -> FilePath -> Int -> TestTree
119121goldenCodeLens recorder title path idx =
120122 goldenWithHaskellDoc (classPlugin recorder) title testDataDir path " expected" " hs" $ \ doc -> do
121123 lens <- getCodeLenses doc
0 commit comments