Skip to content

Commit 2928b02

Browse files
committed
ghcide: Core: Compile: getDocsNonInteractive': docs & comment
1 parent 109f2cb commit 2928b02

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

+5-4
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,10 @@ initTypecheckEnv hsc_env mod = initTc hsc_env HsSrcFile False mod fakeSpan
10231023
fakeSpan :: RealSrcSpan
10241024
fakeSpan = realSrcLocSpan $ mkRealSrcLoc (Util.fsLit "<ghcide>") 1 1
10251025

1026-
1026+
-- | Non-interactive handling of the module interface.
1027+
-- A non-interactive modification of code from the 'GHC.Runtime.Eval.getDocs'.
1028+
-- The interactive paths create problems in ghc-lib builds
1029+
--- and lead to fun errors like "Cannot continue after interface file error".
10271030
getDocsNonInteractive'
10281031
:: Name
10291032
-> IOEnv
@@ -1034,7 +1037,7 @@ getDocsNonInteractive'
10341037
getDocsNonInteractive' name =
10351038
case nameModule_maybe name of
10361039
Nothing -> return (name, Left $ NameHasNoModule name)
1037-
Just mod -> do
1040+
Just mod -> do -- in GHC here was an interactive check & handling.
10381041
ModIface
10391042
{ mi_doc_hdr = mb_doc_hdr
10401043
, mi_decl_docs = DeclDocMap dmap
@@ -1053,8 +1056,6 @@ getDocsNonInteractive' name =
10531056
else Right (Map.lookup name dmap, Map.lookup name amap)
10541057

10551058
-- | Non-interactive modification of 'GHC.Runtime.Eval.getDocs'.
1056-
-- The interactive paths create problems in ghc-lib builds
1057-
--- and lead to fun errors like "Cannot continue after interface file error".
10581059
getDocsNonInteractive :: HscEnv -> Module -> Name -> IO (Either GHC.ErrorMessages (Name, Either GetDocsFailure (Maybe HsDocString, Maybe (Map.Map Int HsDocString))))
10591060
getDocsNonInteractive hsc_env mod name = do
10601061
((_warns,errs), res) <- initTypecheckEnv hsc_env mod $ getDocsNonInteractive' name

0 commit comments

Comments
 (0)