@@ -996,7 +996,10 @@ initTypecheckEnv hsc_env mod = initTc hsc_env HsSrcFile False mod fakeSpan
996
996
fakeSpan :: RealSrcSpan
997
997
fakeSpan = realSrcLocSpan $ mkRealSrcLoc (Util. fsLit " <ghcide>" ) 1 1
998
998
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".
1000
1003
getDocsNonInteractive'
1001
1004
:: Name
1002
1005
-> IOEnv
@@ -1007,7 +1010,7 @@ getDocsNonInteractive'
1007
1010
getDocsNonInteractive' name =
1008
1011
case nameModule_maybe name of
1009
1012
Nothing -> return (name, Left $ NameHasNoModule name)
1010
- Just mod -> do
1013
+ Just mod -> do -- in GHC here was an interactive check & handling.
1011
1014
ModIface
1012
1015
{ mi_doc_hdr = mb_doc_hdr
1013
1016
, mi_decl_docs = DeclDocMap dmap
@@ -1026,8 +1029,6 @@ getDocsNonInteractive' name =
1026
1029
else Right (Map. lookup name dmap, Map. lookup name amap)
1027
1030
1028
1031
-- | 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".
1031
1032
getDocsNonInteractive :: HscEnv -> Module -> Name -> IO (Either GHC. ErrorMessages (Name , Either GetDocsFailure (Maybe HsDocString , Maybe (Map. Map Int HsDocString ))))
1032
1033
getDocsNonInteractive hsc_env mod name = do
1033
1034
((_warns,errs), res) <- initTypecheckEnv hsc_env mod $ getDocsNonInteractive' name
0 commit comments