@@ -24,7 +24,9 @@ module Development.IDE.UtilGHC(
2424 importGenerated,
2525 mkImport,
2626 runGhcFast,
27− Development.IDE.UtilGHC.RealLocated,
27+ setImports,
28+ setPackageState,
29+ setThisInstalledUnitId,
2830 modIsInternal
2931 ) where
3032
@@ -168,6 +170,23 @@ fakeLlvmConfig :: (LlvmTargets, LlvmPasses)
168170fakeLlvmConfig = ([], [])
169171
170172
173+setThisInstalledUnitId :: UnitId -> DynFlags -> DynFlags
174+setThisInstalledUnitId unitId dflags =
175+ dflags {thisInstalledUnitId = toInstalledUnitId unitId}
176+
177+setImports :: [FilePath] -> DynFlags -> DynFlags
178+setImports paths dflags = dflags { importPaths = paths }
179+
180+setPackageState :: PackageState -> DynFlags -> DynFlags
181+setPackageState state dflags =
182+ dflags
183+ { pkgDatabase = pkgStateDb state
184+ , pkgState = pkgStateState state
185+ , thisUnitIdInsts_ = pkgThisUnitIdInsts state
186+ }
187+
188+
189+
171190-- Orphan instances for types from the GHC API.
172191instance Show CoreModule where show = prettyPrint
173192instance NFData CoreModule where rnf !_ = ()
@@ -194,5 +213,3 @@ instance Show (GenLocated SrcSpan ModuleName) where show = prettyPrint
194213instance Show PackageName where show = prettyPrint
195214instance Show Packages.PackageState where show _ = "PackageState"
196215instance Show Name where show = prettyPrint
197−
198−type RealLocated = GenLocated RealSrcSpan