@@ -24,7 +24,9 @@ module Development.IDE.UtilGHC(
24 importGenerated,
24 importGenerated,
26 runGhcFast,
26 runGhcFast,
27− Development.IDE.UtilGHC.RealLocated,
27+ setImports,
29+ setThisInstalledUnitId,
28 modIsInternal
30 modIsInternal
@@ -168,6 +170,23 @@ fakeLlvmConfig :: (LlvmTargets, LlvmPasses)
168fakeLlvmConfig = ([], [])
170fakeLlvmConfig = ([], [])
173+setThisInstalledUnitId :: UnitId -> DynFlags -> DynFlags
174+setThisInstalledUnitId unitId dflags =
175+ dflags {thisInstalledUnitId = toInstalledUnitId unitId}
177+setImports :: [FilePath] -> DynFlags -> DynFlags
178+setImports paths dflags = dflags { importPaths = paths }
180+setPackageState :: PackageState -> DynFlags -> DynFlags
181+setPackageState state dflags =
183+ { pkgDatabase = pkgStateDb state
184+ , pkgState = pkgStateState state
185+ , thisUnitIdInsts_ = pkgThisUnitIdInsts state
171-- Orphan instances for types from the GHC API.
190-- Orphan instances for types from the GHC API.
172instance Show CoreModule where show = prettyPrint
191instance Show CoreModule where show = prettyPrint
173instance NFData CoreModule where rnf !_ = ()
192instance NFData CoreModule where rnf !_ = ()
@@ -194,5 +213,3 @@ instance Show (GenLocated SrcSpan ModuleName) where show = prettyPrint
194instance Show PackageName where show = prettyPrint
213instance Show PackageName where show = prettyPrint
195instance Show Packages.PackageState where show _ = "PackageState"
214instance Show Packages.PackageState where show _ = "PackageState"
196instance Show Name where show = prettyPrint
215instance Show Name where show = prettyPrint
198−type RealLocated = GenLocated RealSrcSpan