Skip to content

Commit a56bd0c

Browse files
committed
ghcide: Core: Compile: getDocsNonInteractive': docs & comment
1 parent df491d0 commit a56bd0c

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
@@ -997,7 +997,10 @@ initTypecheckEnv hsc_env mod = initTc hsc_env HsSrcFile False mod fakeSpan
997997
fakeSpan :: RealSrcSpan
998998
fakeSpan = realSrcLocSpan $ mkRealSrcLoc (Util.fsLit "<ghcide>") 1 1
999999

1000-
1000+
-- | Non-interactive handling of the module interface.
1001+
-- A non-interactive modification of code from the 'GHC.Runtime.Eval.getDocs'.
1002+
-- The interactive paths create problems in ghc-lib builds
1003+
--- and lead to fun errors like "Cannot continue after interface file error".
10011004
getDocsNonInteractive'
10021005
:: Name
10031006
-> IOEnv
@@ -1008,7 +1011,7 @@ getDocsNonInteractive'
10081011
getDocsNonInteractive' name =
10091012
case nameModule_maybe name of
10101013
Nothing -> return (name, Left $ NameHasNoModule name)
1011-
Just mod -> do
1014+
Just mod -> do -- in GHC here was an interactive check & handling.
10121015
ModIface
10131016
{ mi_doc_hdr = mb_doc_hdr
10141017
, mi_decl_docs = DeclDocMap dmap
@@ -1027,8 +1030,6 @@ getDocsNonInteractive' name =
10271030
else Right (Map.lookup name dmap, Map.lookup name amap)
10281031

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

0 commit comments

Comments
 (0)