Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Commit

Permalink
Normalise file targets after loading
Browse files Browse the repository at this point in the history
  • Loading branch information
fendor committed Nov 17, 2020
1 parent 923a7f2 commit 7ce49a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions session-loader/Development/IDE/Session.hs
Original file line number Diff line number Diff line change
Expand Up @@ -615,9 +615,10 @@ memoIO op = do
Just res -> return (mp, res)

-- | Throws if package flags are unsatisfiable
setOptions :: GhcMonad m => ComponentOptions -> DynFlags -> m (DynFlags, [GHC.Target])
setOptions :: (MonadIO m, GhcMonad m) => ComponentOptions -> DynFlags -> m (DynFlags, [GHC.Target])
setOptions (ComponentOptions theOpts compRoot _) dflags = do
(dflags', targets) <- addCmdOpts theOpts dflags
(dflags', targets') <- addCmdOpts theOpts dflags
let targets = makeTargetsAbsolute compRoot targets'
let dflags'' =
disableWarningsAsErrors $
-- disabled, generated directly by ghcide instead
Expand Down
2 changes: 1 addition & 1 deletion test/exe/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3282,7 +3282,7 @@ ignoreFatalWarning = testCase "ignore-fatal-warning" $ runWithExtraFiles "ignore
expectNoMoreDiagnostics 5

simpleSubDirectoryTest :: TestTree
simpleSubDirectoryTest = expectFailBecause "File Targets are not normalised" $
simpleSubDirectoryTest =
testCase "simple-subdirectory" $ runWithExtraFiles "cabal-exe" $ \dir -> do
let mainPath = dir </> "a/src/Main.hs"
mainSource <- liftIO $ readFileUtf8 mainPath
Expand Down

0 comments on commit 7ce49a9

Please sign in to comment.