File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
ghcide/session-loader/Development/IDE Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -525,12 +525,15 @@ cradleToOptsAndLibDir cradle file = do
525525
526526emptyHscEnv :: IORef NameCache -> FilePath -> IO HscEnv
527527emptyHscEnv nc libDir = do
528+ #if MIN_VERSION_ghc(9,0,0)
529+ -- Without the seemingly redundant `getSessionDynFlags >>= setSessionDynFlags`
530+ -- the line `initDynLinker env` would crash with the errror:
531+ -- `Couldn't find a target code interpreter. Try with -fexternal-interpreter`
532+ env <- runGhc (Just libDir) $ getSessionDynFlags >>= setSessionDynFlags >> getSession
533+ #else
528534 env <- runGhc (Just libDir) getSession
529- #if !MIN_VERSION_ghc(9,0,0)
530- -- This causes ghc9 to crash with the error:
531- -- Couldn't find a target code interpreter. Try with -fexternal-interpreter
532- initDynLinker env
533535#endif
536+ initDynLinker env
534537 pure $ setNameCache nc env{ hsc_dflags = (hsc_dflags env){useUnicode = True } }
535538
536539data TargetDetails = TargetDetails
You can’t perform that action at this time.
0 commit comments