on bec100b help sign in
46 lines 1.7 kB history raw
1-- Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
2-- SPDX-License-Identifier: Apache-2.0
4{-# LANGUAGE RankNTypes #-}
6-- | Options
7module Development.IDE.Types.Options
8 ( IdeOptions(..)
9 , IdePkgLocationOptions(..)
10 ) where
12import Development.IDE.UtilGHC
13import GHC hiding (parseModule, typecheckModule)
14import GhcPlugins as GHC hiding (fst3, (<>))
17data IdeOptions = IdeOptions
18 { optPreprocessor :: GHC.ParsedSource -> ([(GHC.SrcSpan, String)], GHC.ParsedSource)
19 , optRunGhcSession :: forall a. Maybe ParsedModule -> PackageDynFlags -> Ghc a -> IO a
20 -- ^ Setup a GHC session using a given package state. If a `ParsedModule` is supplied,
21 -- the import path should be setup for that module.
22 , optPkgLocationOpts :: IdePkgLocationOptions
23 , optWriteIface :: Bool
24 , optExtensions :: [String]
26 , optMbPackageName :: Maybe String
28 , optPackageDbs :: [FilePath]
29 , optHideAllPkgs :: Bool
30 , optPackageImports :: [(String, ModRenaming)]
32 , optThreads :: Int
33 , optShakeProfiling :: Maybe FilePath
34 }
37-- | The set of options used to locate files belonging to external packages.
38data IdePkgLocationOptions = IdePkgLocationOptions
39 { optLocateHieFile :: PackageConfig -> Module -> IO (Maybe FilePath)
40 -- ^ Locate the HIE file for the given module. The PackageConfig can be
41 -- used to lookup settings like importDirs.
42 , optLocateSrcFile :: PackageConfig -> Module -> IO (Maybe FilePath)
43 -- ^ Locate the source file for the given module. The PackageConfig can be
44 -- used to lookup settings like importDirs. For DAML, we place them in the package DB.
45 -- For cabal this could point somewhere in ~/.cabal/packages.
46 }