Skip to content

Commit d452740

Browse files
committed
Reset ModSummary
1 parent 916a93d commit d452740

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ghcide/src/Development/IDE/Core/Rules.hs

+5-3
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,12 @@ getParsedModuleRule =
220220

221221
let dflags = ms_hspp_opts ms
222222
mainParse = getParsedModuleDefinition hsc opt file ms
223+
reset_ms pm = pm { pm_mod_summary = ms' }
223224

224225
-- Parse again (if necessary) to capture Haddock parse errors
225226
res@(_,pmod) <- if gopt Opt_Haddock dflags
226227
then
227-
liftIO mainParse
228+
liftIO $ fmap (fmap (fmap reset_ms)) mainParse
228229
else do
229230
let haddockParse = getParsedModuleDefinition hsc opt file (withOptHaddock ms)
230231

@@ -234,7 +235,7 @@ getParsedModuleRule =
234235
-- If we can parse Haddocks, might as well use them
235236
--
236237
-- HLINT INTEGRATION: might need to save the other parsed module too
237-
((diags,res),(diagsh,resh)) <- liftIO $ concurrently mainParse haddockParse
238+
((diags,res),(diagsh,resh)) <- liftIO $ fmap (fmap (fmap (fmap reset_ms))) $ concurrently mainParse haddockParse
238239

239240
-- Merge haddock and regular diagnostics so we can always report haddock
240241
-- parse errors
@@ -288,8 +289,9 @@ getParsedModuleWithCommentsRule =
288289
let ms' = withoutOption Opt_Haddock $ withOption Opt_KeepRawTokenStream ms
289290
modify_dflags <- getModifyDynFlags id dynFlagsModifyParser
290291
let ms = ms' { ms_hspp_opts = modify_dflags $ ms_hspp_opts ms' }
292+
reset_ms pm = pm { pm_mod_summary = ms' }
291293

292-
liftIO $ snd <$> getParsedModuleDefinition (hscEnv sess) opt file ms
294+
liftIO $ fmap (fmap reset_ms) $ snd <$> getParsedModuleDefinition (hscEnv sess) opt file ms
293295

294296
getModifyDynFlags :: a -> (DynFlagsModifications -> a) -> Action a
295297
getModifyDynFlags a f = maybe a (f . dynFlagsMods) <$> getShakeExtra

0 commit comments

Comments
 (0)