From f7d97463a1c29718ac856f6c53954d45ccd3aea6 Mon Sep 17 00:00:00 2001 From: Alejandro Serrano Date: Fri, 24 Jan 2020 21:38:56 +0100 Subject: [PATCH] Enable -haddock at parsing time --- src/Development/IDE/Core/Compile.hs | 3 ++- test/exe/Main.hs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Development/IDE/Core/Compile.hs b/src/Development/IDE/Core/Compile.hs index f02d5eca6..6780c3f8d 100644 --- a/src/Development/IDE/Core/Compile.hs +++ b/src/Development/IDE/Core/Compile.hs @@ -69,9 +69,10 @@ parseModule -> Maybe SB.StringBuffer -> IO ([FileDiagnostic], Maybe ParsedModule) parseModule IdeOptions{..} env file = + let env' = env { hsc_dflags = hsc_dflags env `gopt_set` Opt_Haddock } in fmap (either (, Nothing) (second Just)) . -- We need packages since imports fail to resolve otherwise. - runGhcEnv env . runExceptT . parseFileContents optPreprocessor file + runGhcEnv env' . runExceptT . parseFileContents optPreprocessor file -- | Given a package identifier, what packages does it depend on diff --git a/test/exe/Main.hs b/test/exe/Main.hs index f3647f685..5526f8fd7 100644 --- a/test/exe/Main.hs +++ b/test/exe/Main.hs @@ -1183,7 +1183,7 @@ findDefinitionAndHoverTests = let , test yes yes mclL36 mcl "top-level fn 1st clause" , test yes yes mclL37 mcl "top-level fn 2nd clause #246" , test yes yes spaceL37 space "top-level fn on space #315" - , test no broken docL41 doc "documentation #7" + , test no yes docL41 doc "documentation #7" , test no yes eitL40 kindE "kind of Either #273" , test no yes intL40 kindI "kind of Int #273" , test no broken tvrL40 kindV "kind of (* -> *) type variable #273"