|
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 |
2 | 4 | -- `hscTypecheckRenameWithDiagnostics`.
|
| 5 | +-- ============================================================================ |
| 6 | + |
3 | 7 | module Development.IDE.GHC.Compat.Driver
|
4 | 8 | ( hscTypecheckRenameWithDiagnostics
|
5 | 9 | ) where
|
@@ -31,17 +35,14 @@ import GHC.Data.FastString
|
31 | 35 | import GHC.Data.Maybe
|
32 | 36 | import Control.Monad
|
33 | 37 |
|
34 |
| --- ----------------------------------------------------------------------------- |
35 |
| --- | Rename and typecheck a module the same way that GHC does, additionally returning the renamed syntax and the diagnostics produced. |
36 | 38 | hscTypecheckRenameWithDiagnostics :: HscEnv -> ModSummary -> HsParsedModule
|
37 | 39 | -> IO ((TcGblEnv, RenamedStuff), Messages GhcMessage)
|
38 | 40 | hscTypecheckRenameWithDiagnostics hsc_env mod_summary rdr_module = runHsc' hsc_env $
|
39 | 41 | hsc_typecheck True mod_summary (Just rdr_module)
|
40 | 42 |
|
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 | +-- ============================================================================ |
45 | 46 | hsc_typecheck :: Bool -- ^ Keep renamed source?
|
46 | 47 | -> ModSummary -> Maybe HsParsedModule
|
47 | 48 | -> Hsc (TcGblEnv, RenamedStuff)
|
@@ -73,6 +74,9 @@ hsc_typecheck keep_rn mod_summary mb_rdr_module = do
|
73 | 74 | rn_info <- extract_renamed_stuff mod_summary tc_result
|
74 | 75 | return (tc_result, rn_info)
|
75 | 76 |
|
| 77 | +-- ============================================================================ |
| 78 | +-- DO NOT EDIT - Refer to top of file |
| 79 | +-- ============================================================================ |
76 | 80 | extract_renamed_stuff :: ModSummary -> TcGblEnv -> Hsc RenamedStuff
|
77 | 81 | extract_renamed_stuff mod_summary tc_result = do
|
78 | 82 | let rn_info = getRenamedStuff tc_result
|
@@ -112,8 +116,9 @@ extract_renamed_stuff mod_summary tc_result = do
|
112 | 116 | mapM_ (putMsg logger') xs
|
113 | 117 | return rn_info
|
114 | 118 |
|
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 | +-- ============================================================================ |
117 | 122 | hscSimpleIface :: HscEnv
|
118 | 123 | -> Maybe CoreProgram
|
119 | 124 | -> TcGblEnv
|
|
0 commit comments