Safe Haskell | None |
---|---|
Language | Haskell2010 |
The logic for setting up a ghcide session by tapping into hie-bios.
Synopsis
- data SessionLoadingOptions = SessionLoadingOptions {
- findCradle :: FilePath -> IO (Maybe FilePath)
- loadCradle :: FilePath -> IO (Cradle Void)
- getCacheDirs :: String -> [String] -> IO CacheDirs
- getInitialGhcLibDir :: IO (Maybe LibDir)
- fakeUid :: InstalledUnitId
- data CacheDirs = CacheDirs {}
- loadSession :: FilePath -> IO (Action IdeGhcSession)
- loadSessionWithOptions :: SessionLoadingOptions -> FilePath -> IO (Action IdeGhcSession)
- setInitialDynFlags :: SessionLoadingOptions -> IO (Maybe LibDir)
- getHieDbLoc :: FilePath -> IO FilePath
- runWithDb :: FilePath -> (HieDb -> IndexQueue -> IO ()) -> IO ()
Documentation
data SessionLoadingOptions Source #
SessionLoadingOptions | |
|
Instances
Default SessionLoadingOptions Source # | |
Defined in Development.IDE.Session |
loadSession :: FilePath -> IO (Action IdeGhcSession) Source #
Given a root directory, return a Shake Action
which setups an
IdeGhcSession
given a file.
Some of the many things this does:
- Find the cradle for the file
- Get the session options,
- Get the GHC lib directory
- Make sure the GHC compiletime and runtime versions match
- Restart the Shake session
This is the key function which implements multi-component support. All components mapping to the same hie.yaml file are mapped to the same HscEnv which is updated as new components are discovered.
setInitialDynFlags :: SessionLoadingOptions -> IO (Maybe LibDir) Source #
Sets unsafeGlobalDynFlags
on using the hie-bios cradle and returns the GHC libdir
runWithDb :: FilePath -> (HieDb -> IndexQueue -> IO ()) -> IO () Source #
Wraps withHieDb
to provide a database connection for reading, and a HieWriterChan
for
writing. Actions are picked off one by one from the HieWriterChan
and executed in serial
by a worker thread using a dedicated database connection.
This is done in order to serialize writes to the database, or else SQLite becomes unhappy