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 #-}
7module Development.IDE.Types.Options
9 , IdePkgLocationOptions(..)
13import Development.Shake
14import GHC hiding (parseModule, typecheckModule)
15import GhcPlugins as GHC hiding (fst3, (<>))
18data IdeOptions = IdeOptions
19 { optPreprocessor :: GHC.ParsedSource -> ([(GHC.SrcSpan, String)], GHC.ParsedSource)
20 , optGhcSession :: Action HscEnv
21 -- ^ Setup a GHC session using a given package state. If a `ParsedModule` is supplied,
22 -- the import path should be setup for that module.
23 , optPkgLocationOpts :: IdePkgLocationOptions
24 , optWriteIface :: Bool
25 , optExtensions :: [String]
28 , optShakeProfiling :: Maybe FilePath
29 , optLanguageSyntax :: String -- ^ the ```language to use
30 , optNewColonConvention :: Bool -- ^ whether to use new colon convention
33defaultIdeOptions :: Action HscEnv -> IdeOptions
34defaultIdeOptions session = IdeOptions
35 {optPreprocessor = (,) []
36 ,optWriteIface = False
37 ,optGhcSession = session
38 ,optExtensions = ["hs"]
39 ,optPkgLocationOpts = defaultIdePkgLocationOptions
41 ,optShakeProfiling = Nothing
42 ,optLanguageSyntax = "haskell"
43 ,optNewColonConvention = False
47-- | The set of options used to locate files belonging to external packages.
48data IdePkgLocationOptions = IdePkgLocationOptions
49 { optLocateHieFile :: PackageConfig -> Module -> IO (Maybe FilePath)
50 -- ^ Locate the HIE file for the given module. The PackageConfig can be
51 -- used to lookup settings like importDirs.
52 , optLocateSrcFile :: PackageConfig -> Module -> IO (Maybe FilePath)
53 -- ^ Locate the source file for the given module. The PackageConfig can be
54 -- used to lookup settings like importDirs. For DAML, we place them in the package DB.
55 -- For cabal this could point somewhere in ~/.cabal/packages.
58defaultIdePkgLocationOptions :: IdePkgLocationOptions
59defaultIdePkgLocationOptions = IdePkgLocationOptions f f
60 where f _ _ = return Nothing
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list