Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
pepeiborra committed Oct 24, 2021
1 parent 7dfc9eb commit 71f5f95
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
15 changes: 5 additions & 10 deletions ghcide/test/exe/Main.hs
Expand Up @@ -50,7 +50,7 @@ import Development.IDE.Test (Cursor,
expectNoMoreDiagnostics,
flushMessages,
standardizeQuotes,
waitForAction)
waitForAction, getInterfaceFilesDir)
import Development.IDE.Test.Runfiles
import qualified Development.IDE.Types.Diagnostics as Diagnostics
import Development.IDE.Types.Location
Expand Down Expand Up @@ -95,7 +95,7 @@ import Data.Tuple.Extra
import Development.IDE.Core.FileStore (getModTime)
import Development.IDE.Plugin.CodeAction (matchRegExMultipleImports)
import qualified Development.IDE.Plugin.HLS.GhcIde as Ghcide
import Development.IDE.Plugin.Test (TestRequest (BlockSeconds, GetInterfaceFilesDir),
import Development.IDE.Plugin.Test (TestRequest (BlockSeconds),
WaitForIdeRuleResult (..),
blockCommandId)
import Ide.PluginUtils (pluginDescToIdePlugins)
Expand Down Expand Up @@ -5249,14 +5249,9 @@ ifaceErrorTest = testCase "iface-error-test-1" $ runWithExtraFiles "recomp" $ \d


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

pdoc <- createDoc pPath "haskell" pSource
changeDoc pdoc [TextDocumentContentChangeEvent Nothing Nothing $ pSource <> "\nfoo = y :: Bool" ]
Expand Down
4 changes: 4 additions & 0 deletions ghcide/test/src/Development/IDE/Test.hs
Expand Up @@ -21,6 +21,7 @@ module Development.IDE.Test
, flushMessages
, waitForAction
, getLastBuildKeys
, getInterfaceFilesDir
) where

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

getLastBuildKeys :: Session (Either ResponseError [T.Text])
getLastBuildKeys = callTestPlugin GetLastBuildKeys

getInterfaceFilesDir :: TextDocumentIdentifier -> Session (Either ResponseError FilePath)
getInterfaceFilesDir TextDocumentIdentifier{_uri} = callTestPlugin (GetInterfaceFilesDir _uri)

0 comments on commit 71f5f95

Please sign in to comment.