@@ -12,12 +12,12 @@ module Development.IDE.Core.Service(
12
12
getIdeOptions , getIdeOptionsIO ,
13
13
IdeState , initialise , shutdown ,
14
14
runAction ,
15
- writeProfile ,
16
15
getDiagnostics ,
17
16
ideLogger ,
18
17
updatePositionMapping ,
19
18
) where
20
19
20
+ import Control.Applicative ((<|>) )
21
21
import Development.IDE.Core.Debouncer
22
22
import Development.IDE.Core.FileExists (fileExistsRules )
23
23
import Development.IDE.Core.OfInterest
@@ -30,6 +30,7 @@ import qualified Language.LSP.Types as LSP
30
30
31
31
import Control.Monad
32
32
import Development.IDE.Core.Shake
33
+ import System.Environment (lookupEnv )
33
34
34
35
35
36
------------------------------------------------------------
@@ -46,13 +47,17 @@ initialise :: Config
46
47
-> HieDb
47
48
-> IndexQueue
48
49
-> 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
50
55
shakeOpen
51
56
lspEnv
52
57
defaultConfig
53
58
logger
54
59
debouncer
55
- (optShakeProfiling options)
60
+ shakeProfiling
56
61
(optReportProgress options)
57
62
(optTesting options)
58
63
hiedb
@@ -65,9 +70,6 @@ initialise defaultConfig mainRule lspEnv logger debouncer options vfs hiedb hied
65
70
fileExistsRules lspEnv vfs
66
71
mainRule
67
72
68
- writeProfile :: IdeState -> FilePath -> IO ()
69
- writeProfile = shakeProfile
70
-
71
73
-- | Shutdown the Compiler Service.
72
74
shutdown :: IdeState -> IO ()
73
75
shutdown = shakeShut
0 commit comments