mirror of
https://github.com/haskell/ghcide.git
synced 2024-12-17 23:22:04 +03:00
Minor IDE cleanups (#945)
* Kill RealLocated, it just duplicates something already in GHC * Move some things back to UtilGHC, they are useful for setting DynFlags values
This commit is contained in:
parent
af56be6dfb
commit
b9dfd499dd
@ -13,9 +13,10 @@ import Data.Maybe
|
||||
import qualified Data.Text as T
|
||||
import Development.IDE.Functions.GHCError
|
||||
import Development.IDE.Functions.SpanInfo
|
||||
import Development.IDE.UtilGHC
|
||||
import FastString
|
||||
import GHC
|
||||
import SrcLoc
|
||||
|
||||
|
||||
getDocumentation
|
||||
:: Name -- ^ The name you want documentation for.
|
||||
|
@ -24,7 +24,9 @@ module Development.IDE.UtilGHC(
|
||||
importGenerated,
|
||||
mkImport,
|
||||
runGhcFast,
|
||||
Development.IDE.UtilGHC.RealLocated,
|
||||
setImports,
|
||||
setPackageState,
|
||||
setThisInstalledUnitId,
|
||||
modIsInternal
|
||||
) where
|
||||
|
||||
@ -168,6 +170,23 @@ fakeLlvmConfig :: (LlvmTargets, LlvmPasses)
|
||||
fakeLlvmConfig = ([], [])
|
||||
|
||||
|
||||
setThisInstalledUnitId :: UnitId -> DynFlags -> DynFlags
|
||||
setThisInstalledUnitId unitId dflags =
|
||||
dflags {thisInstalledUnitId = toInstalledUnitId unitId}
|
||||
|
||||
setImports :: [FilePath] -> DynFlags -> DynFlags
|
||||
setImports paths dflags = dflags { importPaths = paths }
|
||||
|
||||
setPackageState :: PackageState -> DynFlags -> DynFlags
|
||||
setPackageState state dflags =
|
||||
dflags
|
||||
{ pkgDatabase = pkgStateDb state
|
||||
, pkgState = pkgStateState state
|
||||
, thisUnitIdInsts_ = pkgThisUnitIdInsts state
|
||||
}
|
||||
|
||||
|
||||
|
||||
-- Orphan instances for types from the GHC API.
|
||||
instance Show CoreModule where show = prettyPrint
|
||||
instance NFData CoreModule where rnf !_ = ()
|
||||
@ -194,5 +213,3 @@ instance Show (GenLocated SrcSpan ModuleName) where show = prettyPrint
|
||||
instance Show PackageName where show = prettyPrint
|
||||
instance Show Packages.PackageState where show _ = "PackageState"
|
||||
instance Show Name where show = prettyPrint
|
||||
|
||||
type RealLocated = GenLocated RealSrcSpan
|
||||
|
Loading…
Reference in New Issue
Block a user