Skip to content

Commit 4b91cdf

Browse files
committed
ghcide: Core: Compile: getDocsNonInteractive': docs & comment
1 parent 4288062 commit 4b91cdf

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,10 @@ initTypecheckEnv hsc_env mod = initTc hsc_env HsSrcFile False mod fakeSpan
996996
fakeSpan :: RealSrcSpan
997997
fakeSpan = realSrcLocSpan $ mkRealSrcLoc (Util.fsLit "<ghcide>") 1 1
998998

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

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

0 commit comments

Comments
 (0)