Skip to content

Commit 0cf77e5

Browse files
committed
Add scary comments all over copied code in Compat.Driver
1 parent ae50843 commit 0cf77e5

File tree

1 file changed

+14
-9
lines changed
  • ghcide/src/Development/IDE/GHC/Compat

1 file changed

+14
-9
lines changed

ghcide/src/Development/IDE/GHC/Compat/Driver.hs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
-- This module copies parts of the driver code in GHC.Main.Driver to provide
1+
-- ============================================================================
2+
-- DO NOT EDIT
3+
-- This module copies parts of the driver code in GHC.Driver.Main to provide
24
-- `hscTypecheckRenameWithDiagnostics`.
5+
-- ============================================================================
6+
37
module Development.IDE.GHC.Compat.Driver
48
( hscTypecheckRenameWithDiagnostics
59
) where
@@ -31,17 +35,14 @@ import GHC.Data.FastString
3135
import GHC.Data.Maybe
3236
import Control.Monad
3337

34-
-- -----------------------------------------------------------------------------
35-
-- | Rename and typecheck a module the same way that GHC does, additionally returning the renamed syntax and the diagnostics produced.
3638
hscTypecheckRenameWithDiagnostics :: HscEnv -> ModSummary -> HsParsedModule
3739
-> IO ((TcGblEnv, RenamedStuff), Messages GhcMessage)
3840
hscTypecheckRenameWithDiagnostics hsc_env mod_summary rdr_module = runHsc' hsc_env $
3941
hsc_typecheck True mod_summary (Just rdr_module)
4042

41-
-- | A bunch of logic piled around @tcRnModule'@, concerning a) backpack
42-
-- b) concerning dumping rename info and hie files. It would be nice to further
43-
-- separate this stuff out, probably in conjunction better separating renaming
44-
-- and type checking (#17781).
43+
-- ============================================================================
44+
-- DO NOT EDIT - Refer to top of file
45+
-- ============================================================================
4546
hsc_typecheck :: Bool -- ^ Keep renamed source?
4647
-> ModSummary -> Maybe HsParsedModule
4748
-> Hsc (TcGblEnv, RenamedStuff)
@@ -73,6 +74,9 @@ hsc_typecheck keep_rn mod_summary mb_rdr_module = do
7374
rn_info <- extract_renamed_stuff mod_summary tc_result
7475
return (tc_result, rn_info)
7576

77+
-- ============================================================================
78+
-- DO NOT EDIT - Refer to top of file
79+
-- ============================================================================
7680
extract_renamed_stuff :: ModSummary -> TcGblEnv -> Hsc RenamedStuff
7781
extract_renamed_stuff mod_summary tc_result = do
7882
let rn_info = getRenamedStuff tc_result
@@ -112,8 +116,9 @@ extract_renamed_stuff mod_summary tc_result = do
112116
mapM_ (putMsg logger') xs
113117
return rn_info
114118

115-
-- | Generate a stripped down interface file, e.g. for boot files or when ghci
116-
-- generates interface files. See Note [simpleTidyPgm - mkBootModDetailsTc]
119+
-- ============================================================================
120+
-- DO NOT EDIT - Refer to top of file
121+
-- ============================================================================
117122
hscSimpleIface :: HscEnv
118123
-> Maybe CoreProgram
119124
-> TcGblEnv

0 commit comments

Comments
 (0)