Skip to content

Commit f9eebba

Browse files
committed
respect default values for shakeOptions
1 parent 82d2693 commit f9eebba

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

Diff for: ghcide/exe/Main.hs

+7-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import Development.IDE.Types.Logger
3030
import Development.IDE.Plugin
3131
import Development.IDE.Plugin.Test as Test
3232
import Development.IDE.Session (loadSession)
33-
import Development.Shake (ShakeOptions (shakeThreads), shakeOptions)
33+
import Development.Shake (ShakeOptions (shakeThreads))
3434
import qualified Language.Haskell.LSP.Core as LSP
3535
import Language.Haskell.LSP.Messages
3636
import Language.Haskell.LSP.Types
@@ -115,15 +115,16 @@ main = do
115115
hPutStrLn stderr $ "Started LSP server in " ++ showDuration t
116116
sessionLoader <- loadSession $ fromMaybe dir rootPath
117117
config <- fromMaybe def <$> getConfig
118-
let options = (defaultIdeOptions sessionLoader)
118+
let options = defOptions
119119
{ optReportProgress = clientSupportsProgress caps
120120
, optShakeProfiling = argsShakeProfiling
121121
, optOTMemoryProfiling = IdeOTMemoryProfiling argsOTMemoryProfiling
122122
, optTesting = IdeTesting argsTesting
123-
, optShakeOptions = shakeOptions{shakeThreads = argsThreads}
123+
, optShakeOptions = (optShakeOptions defOptions){shakeThreads = argsThreads}
124124
, optCheckParents = checkParents config
125125
, optCheckProject = checkProject config
126126
}
127+
defOptions = defaultIdeOptions sessionLoader
127128
logLevel = if argsVerbose then minBound else Info
128129
debouncer <- newAsyncDebouncer
129130
let rules = do
@@ -161,14 +162,15 @@ main = do
161162
debouncer <- newAsyncDebouncer
162163
let dummyWithProg _ _ f = f (const (pure ()))
163164
sessionLoader <- loadSession dir
164-
let options = (defaultIdeOptions sessionLoader)
165+
let options = defOptions
165166
{ optShakeProfiling = argsShakeProfiling
166167
-- , optOTMemoryProfiling = IdeOTMemoryProfiling argsOTMemoryProfiling
167168
, optTesting = IdeTesting argsTesting
168-
, optShakeOptions = shakeOptions{shakeThreads = argsThreads}
169+
, optShakeOptions = (optShakeOptions defOptions){shakeThreads = argsThreads}
169170
, optCheckParents = NeverCheck
170171
, optCheckProject = False
171172
}
173+
defOptions = defaultIdeOptions sessionLoader
172174
logLevel = if argsVerbose then minBound else Info
173175
ide <- initialise def mainRule (pure $ IdInt 0) (showEvent lock) dummyWithProg (const (const id)) (logger logLevel) debouncer options vfs
174176

Diff for: src/Ide/Main.hs

+4-5
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ import System.FilePath
5555
import System.IO
5656
import qualified System.Log.Logger as L
5757
import System.Time.Extra
58-
import Development.Shake (shakeOptions, ShakeOptions (shakeThreads), action)
58+
import Development.Shake (ShakeOptions (shakeThreads), action)
5959

6060
ghcIdePlugins :: T.Text -> IdePlugins IdeState -> (Plugin Config, [T.Text])
6161
ghcIdePlugins pid ps = (asGhcIdePlugin ps, allLspCmdIds' pid ps)
@@ -131,14 +131,13 @@ runLspMode lspArgs@LspArguments{..} idePlugins = do
131131
hPutStrLn stderr $ "Started LSP server in " ++ showDuration t
132132
sessionLoader <- loadSession dir
133133
-- config <- fromMaybe defaultLspConfig <$> getConfig
134-
let options = (defaultIdeOptions sessionLoader)
134+
let options = defOptions
135135
{ optReportProgress = clientSupportsProgress caps
136136
, optShakeProfiling = argsShakeProfiling
137137
, optTesting = IdeTesting argsTesting
138-
, optShakeOptions = shakeOptions{shakeThreads = argsThreads}
139-
-- , optCheckParents = checkParents config
140-
-- , optCheckProject = checkProject config
138+
, optShakeOptions = (optShakeOptions defOptions){shakeThreads = argsThreads}
141139
}
140+
defOptions = defaultIdeOptions sessionLoader
142141
debouncer <- newAsyncDebouncer
143142
initialise caps (mainRule >> pluginRules plugins >> action kick)
144143
getLspId event wProg wIndefProg hlsLogger debouncer options vfs

0 commit comments

Comments
 (0)