@@ -126,6 +126,7 @@ import GHC.Driver.Config.CoreToStg.Prep
126
126
#if MIN_VERSION_ghc(9,7,0)
127
127
import Data.Foldable (toList )
128
128
import GHC.Unit.Module.Warnings
129
+ import Development.IDE.Core.WorkerThread (awaitRunInThread )
129
130
#else
130
131
import Development.IDE.Core.FileStore (shareFilePath )
131
132
#endif
@@ -196,6 +197,7 @@ typecheckModule (IdeDefer defer) hsc tc_helpers pm = do
196
197
where
197
198
demoteIfDefer = if defer then demoteTypeErrorsToWarnings else id
198
199
200
+
199
201
-- | Install hooks to capture the splices as well as the runtime module dependencies
200
202
captureSplicesAndDeps :: TypecheckHelpers -> HscEnv -> (HscEnv -> IO a ) -> IO (a , Splices , ModuleEnv BS. ByteString )
201
203
captureSplicesAndDeps TypecheckHelpers {.. } env k = do
@@ -432,6 +434,7 @@ mkHiFileResultCompile se session' tcm simplified_guts = catchErrs $ do
432
434
let session = hscSetFlags (ms_hspp_opts ms) session'
433
435
ms = pm_mod_summary $ tmrParsed tcm
434
436
437
+ traceM $ " [TRACE] Generating hi file for " ++ show (moduleName $ ms_mod ms)
435
438
(details, guts) <- do
436
439
-- write core file
437
440
-- give variables unique OccNames
@@ -724,11 +727,13 @@ addRelativeImport fp modu dflags = dflags
724
727
-- | Also resets the interface store
725
728
atomicFileWrite :: ShakeExtras -> FilePath -> (FilePath -> IO a ) -> IO a
726
729
atomicFileWrite se targetPath write = do
730
+ -- awaitRunInThread (restartQueue se) $ do
731
+ traceM $ " [TRACE] Writing file: " <> targetPath
727
732
let dir = takeDirectory targetPath
728
733
createDirectoryIfMissing True dir
729
734
(tempFilePath, cleanUp) <- newTempFileWithin dir
730
735
(write tempFilePath >>= \ x -> renameFile tempFilePath targetPath >> atomically (resetInterfaceStore se (toNormalizedFilePath' targetPath)) >> pure x)
731
- `onException` cleanUp
736
+ `onException` ( cleanUp >> throwIO ( userError " atomicFileWrite: write failed " ))
732
737
733
738
generateHieAsts :: HscEnv -> TcModuleResult -> IO ([FileDiagnostic ], Maybe (HieASTs Type ))
734
739
generateHieAsts hscEnv tcm =
0 commit comments