|Utilities to manipulate the session state.
|data CannotOpenCabalProject ||Source|
|data NoCurrentCabalProject ||Source|
|data ComponentDoesNotExist ||Source|
|Setting Session Parameters
Reset the state of the session to a defined default state.
Due to some bugs in GHC this isn't completely possible. For example, GHC
retains instance declarations which can lead to problems when you load a
new module which defines a different instance. (You'll get a conflicting
instance error, which can only be resolved by re-starting GHC.)
Sets the current working directory and notifies GHC about the change.
TODO: do we want to adjust certain flags automatically?
|:: FilePath||Project root directroy
|-> FilePath||Project dist directory (relative)
|-> ScionM ()|
Try to open a Cabal project. The project must already be configured
using the same version of Cabal that Scion was build against.
Use configureCabalProject to automatically configure a project (if it
hasn't been already.)
TODO: Allow other working directories? Would require translating all the
search paths from relative to absolute paths. Furthermore, what should the
output directory be then?
- CannotOpenCabalProject if an error occurs (e.g., not configured
project or configured with incompatible cabal version).
Return the (configured) package description of the current Cabal project.
Return path to the .cabal file of the current Cabal package.
This is useful to identify the project when communicating with Scion from
foreign code, because this does not require serialising the local build
|Run the steps that Cabal would call before building.
Return the current LocalBuildInfo.
The LocalBuildInfo is the result of configuring a Cabal project,
therefore requires that we have a current Cabal project.
Root directory of the current Cabal project.
|-> ScionM [PackageId]|
List of packages that need to be loaded. This corresponds to the
build-depends of the loaded component.
TODO: do something with this depending on Scion mode?
Set GHC's dynamic flags for the given component of the current Cabal
project (see openCabalProject).
Set the targets for a GHC.load command from the meta data of the
current Cabal project.
Make the specified component the active one. Sets the DynFlags to
those specified for the given component. Unloads the possible
|Return the currently active component.
|Wrapper for GHC.load.
|Unload whatever is currently loaded.
Parses the list of Strings as command line arguments and sets the
Does not set the flags if a parse error occurs. XXX: There's currently
no way to find out if there was an error from inside the program.
List all components in the current cabal project.
This can be used to present the user a list of possible items to load.
|Set the verbosity of the GHC API.
|-> ScionM (Either String CompilationResult)||First element is False = step 1 above failed.
Takes an absolute path to a file and attempts to typecheck it.
This performs the following steps:
1. Check whether the file is actually part of the current project. It's
also currently not possible to typecheck a .hs-boot file using this
function. We simply bail out if these conditions are not met.
2. Make sure that all dependencies of the module are up to date.
3. Parse, typecheck, desugar and load the module. The last step is
necessary so that we can we don't have to recompile in the case that
we switch to another module.
4. If the previous step was successful, cache the results in the session
for use by source code inspection utilities. Some of the above steps
are skipped if we know that they are not necessary.
|Return whether the filepath refers to a file inside the current project
root. Return False if there is no current project.
Ensure that all dependencies of the module are already loaded.
Sets focusedModule if it was successful.
Return the ModSummary that refers to the source file.
Assumes that there is exactly one such ModSummary.
|Produced by Haddock version 2.4.2|