@@ -29,34 +29,34 @@ import Test.Hls
2929main :: IO ()
3030main = defaultTestRunner tests
3131
32- evalPlugin :: PluginDescriptor IdeState
33- evalPlugin = Eval. descriptor mempty " eval"
32+ evalPlugin :: Recorder ( WithPriority Eval. Log ) -> PluginDescriptor IdeState
33+ evalPlugin recorder = Eval. descriptor recorder " eval"
3434
3535tests :: TestTree
3636tests =
3737 testGroup " eval"
3838 [ testCase " Produces Evaluate code lenses" $
39- runSessionWithServer evalPlugin testDataDir $ do
39+ runSessionWithServerAndRecorder evalPlugin testDataDir $ do
4040 doc <- openDoc " T1.hs" " haskell"
4141 lenses <- getCodeLenses doc
4242 liftIO $ map (preview $ command . _Just . title) lenses @?= [Just " Evaluate..." ]
4343 , testCase " Produces Refresh code lenses" $
44- runSessionWithServer evalPlugin testDataDir $ do
44+ runSessionWithServerAndRecorder evalPlugin testDataDir $ do
4545 doc <- openDoc " T2.hs" " haskell"
4646 lenses <- getCodeLenses doc
4747 liftIO $ map (preview $ command . _Just . title) lenses @?= [Just " Refresh..." ]
4848 , testCase " Code lenses have ranges" $
49- runSessionWithServer evalPlugin testDataDir $ do
49+ runSessionWithServerAndRecorder evalPlugin testDataDir $ do
5050 doc <- openDoc " T1.hs" " haskell"
5151 lenses <- getCodeLenses doc
5252 liftIO $ map (view range) lenses @?= [Range (Position 4 0 ) (Position 5 0 )]
5353 , testCase " Multi-line expressions have a multi-line range" $ do
54- runSessionWithServer evalPlugin testDataDir $ do
54+ runSessionWithServerAndRecorder evalPlugin testDataDir $ do
5555 doc <- openDoc " T3.hs" " haskell"
5656 lenses <- getCodeLenses doc
5757 liftIO $ map (view range) lenses @?= [Range (Position 3 0 ) (Position 5 0 )]
5858 , testCase " Executed expressions range covers only the expression" $ do
59- runSessionWithServer evalPlugin testDataDir $ do
59+ runSessionWithServerAndRecorder evalPlugin testDataDir $ do
6060 doc <- openDoc " T2.hs" " haskell"
6161 lenses <- getCodeLenses doc
6262 liftIO $ map (view range) lenses @?= [Range (Position 4 0 ) (Position 5 0 )]
@@ -194,7 +194,7 @@ tests =
194194 not (" Baz Foo" `isInfixOf` output) @? " Output includes instance Baz Foo"
195195 ]
196196 , testCase " Interfaces are reused after Eval" $ do
197- runSessionWithServer evalPlugin testDataDir $ do
197+ runSessionWithServerAndRecorder evalPlugin testDataDir $ do
198198 doc <- openDoc " TLocalImport.hs" " haskell"
199199 waitForTypecheck doc
200200 lenses <- getCodeLenses doc
@@ -213,13 +213,13 @@ tests =
213213
214214goldenWithEval :: TestName -> FilePath -> FilePath -> TestTree
215215goldenWithEval title path ext =
216- goldenWithHaskellDoc evalPlugin title testDataDir path " expected" ext executeLensesBackwards
216+ goldenWithHaskellDocAndRecorder evalPlugin title testDataDir path " expected" ext executeLensesBackwards
217217
218218-- | Similar function as 'goldenWithEval' with an alternate reference file
219219-- naming. Useful when reference file may change because of GHC version.
220220goldenWithEval' :: TestName -> FilePath -> FilePath -> FilePath -> TestTree
221221goldenWithEval' title path ext expected =
222- goldenWithHaskellDoc evalPlugin title testDataDir path expected ext executeLensesBackwards
222+ goldenWithHaskellDocAndRecorder evalPlugin title testDataDir path expected ext executeLensesBackwards
223223
224224-- | Execute lenses backwards, to avoid affecting their position in the source file
225225executeLensesBackwards :: TextDocumentIdentifier -> Session ()
@@ -246,7 +246,7 @@ executeCmd cmd = do
246246 pure ()
247247
248248evalLenses :: FilePath -> IO [CodeLens ]
249- evalLenses path = runSessionWithServer evalPlugin testDataDir $ do
249+ evalLenses path = runSessionWithServerAndRecorder evalPlugin testDataDir $ do
250250 doc <- openDoc path " haskell"
251251 executeLensesBackwards doc
252252 getCodeLenses doc
@@ -280,12 +280,12 @@ exceptionConfig exCfg = changeConfig ["exception" .= exCfg]
280280
281281goldenWithEvalConfig' :: TestName -> FilePath -> FilePath -> FilePath -> Config -> TestTree
282282goldenWithEvalConfig' title path ext expected cfg =
283- goldenWithHaskellDoc evalPlugin title testDataDir path expected ext $ \ doc -> do
283+ goldenWithHaskellDocAndRecorder evalPlugin title testDataDir path expected ext $ \ doc -> do
284284 sendConfigurationChanged (toJSON cfg)
285285 executeLensesBackwards doc
286286
287287evalInFile :: HasCallStack => FilePath -> T. Text -> T. Text -> IO ()
288- evalInFile fp e expected = runSessionWithServer evalPlugin testDataDir $ do
288+ evalInFile fp e expected = runSessionWithServerAndRecorder evalPlugin testDataDir $ do
289289 doc <- openDoc fp " haskell"
290290 origin <- documentContents doc
291291 let withEval = origin <> e
0 commit comments