Skip to content

Commit

Permalink
respect default values for shakeOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
pepeiborra committed Jan 14, 2021
1 parent 82d2693 commit f9eebba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
12 changes: 7 additions & 5 deletions ghcide/exe/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import Development.IDE.Types.Logger
import Development.IDE.Plugin
import Development.IDE.Plugin.Test as Test
import Development.IDE.Session (loadSession)
import Development.Shake (ShakeOptions (shakeThreads), shakeOptions)
import Development.Shake (ShakeOptions (shakeThreads))
import qualified Language.Haskell.LSP.Core as LSP
import Language.Haskell.LSP.Messages
import Language.Haskell.LSP.Types
Expand Down Expand Up @@ -115,15 +115,16 @@ main = do
hPutStrLn stderr $ "Started LSP server in " ++ showDuration t
sessionLoader <- loadSession $ fromMaybe dir rootPath
config <- fromMaybe def <$> getConfig
let options = (defaultIdeOptions sessionLoader)
let options = defOptions
{ optReportProgress = clientSupportsProgress caps
, optShakeProfiling = argsShakeProfiling
, optOTMemoryProfiling = IdeOTMemoryProfiling argsOTMemoryProfiling
, optTesting = IdeTesting argsTesting
, optShakeOptions = shakeOptions{shakeThreads = argsThreads}
, optShakeOptions = (optShakeOptions defOptions){shakeThreads = argsThreads}
, optCheckParents = checkParents config
, optCheckProject = checkProject config
}
defOptions = defaultIdeOptions sessionLoader
logLevel = if argsVerbose then minBound else Info
debouncer <- newAsyncDebouncer
let rules = do
Expand Down Expand Up @@ -161,14 +162,15 @@ main = do
debouncer <- newAsyncDebouncer
let dummyWithProg _ _ f = f (const (pure ()))
sessionLoader <- loadSession dir
let options = (defaultIdeOptions sessionLoader)
let options = defOptions
{ optShakeProfiling = argsShakeProfiling
-- , optOTMemoryProfiling = IdeOTMemoryProfiling argsOTMemoryProfiling
, optTesting = IdeTesting argsTesting
, optShakeOptions = shakeOptions{shakeThreads = argsThreads}
, optShakeOptions = (optShakeOptions defOptions){shakeThreads = argsThreads}
, optCheckParents = NeverCheck
, optCheckProject = False
}
defOptions = defaultIdeOptions sessionLoader
logLevel = if argsVerbose then minBound else Info
ide <- initialise def mainRule (pure $ IdInt 0) (showEvent lock) dummyWithProg (const (const id)) (logger logLevel) debouncer options vfs

Expand Down
9 changes: 4 additions & 5 deletions src/Ide/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import System.FilePath
import System.IO
import qualified System.Log.Logger as L
import System.Time.Extra
import Development.Shake (shakeOptions, ShakeOptions (shakeThreads), action)
import Development.Shake (ShakeOptions (shakeThreads), action)

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

0 comments on commit f9eebba

Please sign in to comment.