@@ -12,12 +12,12 @@ module Development.IDE.Core.Service(
1212 getIdeOptions , getIdeOptionsIO ,
1313 IdeState , initialise , shutdown ,
1414 runAction ,
15- writeProfile ,
1615 getDiagnostics ,
1716 ideLogger ,
1817 updatePositionMapping ,
1918 ) where
2019
20+ import Control.Applicative ((<|>) )
2121import Development.IDE.Core.Debouncer
2222import Development.IDE.Core.FileExists (fileExistsRules )
2323import Development.IDE.Core.OfInterest
@@ -30,6 +30,7 @@ import qualified Language.LSP.Types as LSP
3030
3131import Control.Monad
3232import Development.IDE.Core.Shake
33+ import System.Environment (lookupEnv )
3334
3435
3536------------------------------------------------------------
@@ -46,13 +47,17 @@ initialise :: Config
4647 -> HieDb
4748 -> IndexQueue
4849 -> IO IdeState
49- initialise defaultConfig mainRule lspEnv logger debouncer options vfs hiedb hiedbChan =
50+ initialise defaultConfig mainRule lspEnv logger debouncer options vfs hiedb hiedbChan = do
51+ shakeProfiling <- do
52+ let fromConf = optShakeProfiling options
53+ fromEnv <- lookupEnv " GHCIDE_BUILD_PROFILING"
54+ return $ fromConf <|> fromEnv
5055 shakeOpen
5156 lspEnv
5257 defaultConfig
5358 logger
5459 debouncer
55- (optShakeProfiling options)
60+ shakeProfiling
5661 (optReportProgress options)
5762 (optTesting options)
5863 hiedb
@@ -65,9 +70,6 @@ initialise defaultConfig mainRule lspEnv logger debouncer options vfs hiedb hied
6570 fileExistsRules lspEnv vfs
6671 mainRule
6772
68- writeProfile :: IdeState -> FilePath -> IO ()
69- writeProfile = shakeProfile
70-
7173-- | Shutdown the Compiler Service.
7274shutdown :: IdeState -> IO ()
7375shutdown = shakeShut
0 commit comments