Skip to content

Commit f941f93

Browse files
committed
fix build
1 parent 6d4abbc commit f941f93

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

ghcide/test/exe/Main.hs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import Development.IDE.Test (Cursor,
5050
expectNoMoreDiagnostics,
5151
flushMessages,
5252
standardizeQuotes,
53-
waitForAction)
53+
waitForAction, getInterfaceFilesDir)
5454
import Development.IDE.Test.Runfiles
5555
import qualified Development.IDE.Types.Diagnostics as Diagnostics
5656
import Development.IDE.Types.Location
@@ -95,7 +95,7 @@ import Data.Tuple.Extra
9595
import Development.IDE.Core.FileStore (getModTime)
9696
import Development.IDE.Plugin.CodeAction (matchRegExMultipleImports)
9797
import qualified Development.IDE.Plugin.HLS.GhcIde as Ghcide
98-
import Development.IDE.Plugin.Test (TestRequest (BlockSeconds, GetInterfaceFilesDir),
98+
import Development.IDE.Plugin.Test (TestRequest (BlockSeconds),
9999
WaitForIdeRuleResult (..),
100100
blockCommandId)
101101
import Ide.PluginUtils (pluginDescToIdePlugins)
@@ -5249,14 +5249,9 @@ ifaceErrorTest = testCase "iface-error-test-1" $ runWithExtraFiles "recomp" $ \d
52495249

52505250

52515251
-- Check that we wrote the interfaces for B when we saved
5252-
let m = SCustomMethod "test"
5253-
lid <- sendRequest m $ toJSON $ GetInterfaceFilesDir bPath
5254-
res <- skipManyTill anyMessage $ responseForId m lid
5255-
liftIO $ case res of
5256-
ResponseMessage{_result=Right (A.fromJSON -> A.Success hidir)} -> do
5257-
hi_exists <- doesFileExist $ hidir </> "B.hi"
5258-
assertBool ("Couldn't find B.hi in " ++ hidir) hi_exists
5259-
_ -> assertFailure $ "Got malformed response for CustomMessage hidir: " ++ show res
5252+
Right hidir <- getInterfaceFilesDir bdoc
5253+
hi_exists <- liftIO $ doesFileExist $ hidir </> "B.hi"
5254+
liftIO $ assertBool ("Couldn't find B.hi in " ++ hidir) hi_exists
52605255

52615256
pdoc <- createDoc pPath "haskell" pSource
52625257
changeDoc pdoc [TextDocumentContentChangeEvent Nothing Nothing $ pSource <> "\nfoo = y :: Bool" ]

ghcide/test/src/Development/IDE/Test.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module Development.IDE.Test
2121
, flushMessages
2222
, waitForAction
2323
, getLastBuildKeys
24+
, getInterfaceFilesDir
2425
) where
2526

2627
import Control.Applicative.Combinators
@@ -187,3 +188,6 @@ waitForAction key TextDocumentIdentifier{_uri} =
187188

188189
getLastBuildKeys :: Session (Either ResponseError [T.Text])
189190
getLastBuildKeys = callTestPlugin GetLastBuildKeys
191+
192+
getInterfaceFilesDir :: TextDocumentIdentifier -> Session (Either ResponseError FilePath)
193+
getInterfaceFilesDir TextDocumentIdentifier{_uri} = callTestPlugin (GetInterfaceFilesDir _uri)

0 commit comments

Comments
 (0)