@@ -9,9 +9,9 @@ module Main
9
9
) where
10
10
11
11
import Control.Lens (_Just , folded , preview ,
12
- toListOf , view , (^..) )
12
+ view , (^..) , (^ .) )
13
13
import Data.Aeson (Value (Object ), fromJSON ,
14
- object , toJSON , (.=) )
14
+ object , (.=) )
15
15
import Data.Aeson.Types (Pair , Result (Success ))
16
16
import Data.List (isInfixOf )
17
17
import Data.List.Extra (nubOrdOn )
@@ -23,10 +23,7 @@ import qualified Ide.Plugin.Config as Plugin
23
23
import qualified Ide.Plugin.Eval as Eval
24
24
import Ide.Plugin.Eval.Types (EvalParams (.. ), Section (.. ),
25
25
testOutput )
26
- import Ide.Types (IdePlugins (IdePlugins ))
27
- import Language.LSP.Protocol.Lens (arguments , command , range ,
28
- title )
29
- import Language.LSP.Protocol.Message hiding (error )
26
+ import Language.LSP.Protocol.Lens (command , range , title )
30
27
import System.FilePath ((<.>) , (</>) )
31
28
import Test.Hls
32
29
import qualified Test.Hls.FileSystem as FS
@@ -215,16 +212,17 @@ tests =
215
212
, testCase " Interfaces are reused after Eval" $ do
216
213
runSessionWithServerInTmpDir def evalPlugin (mkFs $ FS. directProjectMulti [" TLocalImport.hs" , " Util.hs" ]) $ do
217
214
doc <- openDoc " TLocalImport.hs" " haskell"
218
- waitForTypecheck doc
215
+ _ <- waitForTypecheck doc
219
216
lenses <- getCodeLenses doc
220
- let ~ cmds@ [cmd] = lenses^.. folded. command. _Just
221
- liftIO $ cmds^.. folded. title @?= [" Evaluate..." ]
217
+ cmd <- liftIO $ case lenses^.. folded. command. _Just of
218
+ [cmd] -> (cmd^. title @?= " Evaluate..." ) >> pure cmd
219
+ cmds -> assertFailure $ " Expected a single command, got " <> show (length cmds)
222
220
223
221
executeCmd cmd
224
222
225
223
-- trigger a rebuild and check that dependency interfaces are not rebuilt
226
224
changeDoc doc []
227
- waitForTypecheck doc
225
+ _ <- waitForTypecheck doc
228
226
Right keys <- getLastBuildKeys
229
227
let ifaceKeys = filter (" GetModIface" `T.isPrefixOf` ) keys
230
228
liftIO $ ifaceKeys @?= []
0 commit comments