on e370589 help sign in
40 lines 1.5 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.Shake
13import GHC hiding (parseModule, typecheckModule)
14import GhcPlugins as GHC hiding (fst3, (<>))
17data IdeOptions = IdeOptions
18 { optPreprocessor :: GHC.ParsedSource -> ([(GHC.SrcSpan, String)], GHC.ParsedSource)
19 , optGhcSession :: Action HscEnv
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 , optThreads :: Int
27 , optShakeProfiling :: Maybe FilePath
28 }
31-- | The set of options used to locate files belonging to external packages.
32data IdePkgLocationOptions = IdePkgLocationOptions
33 { optLocateHieFile :: PackageConfig -> Module -> IO (Maybe FilePath)
34 -- ^ Locate the HIE file for the given module. The PackageConfig can be
35 -- used to lookup settings like importDirs.
36 , optLocateSrcFile :: PackageConfig -> Module -> IO (Maybe FilePath)
37 -- ^ Locate the source file for the given module. The PackageConfig can be
38 -- used to lookup settings like importDirs. For DAML, we place them in the package DB.
39 -- For cabal this could point somewhere in ~/.cabal/packages.
40 }