From 0f5e9c777480f5629bedb2782c910746fed579aa Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Thu, 14 Jan 2021 19:35:18 +0000 Subject: [PATCH] respect default values for shakeOptions --- ghcide/exe/Main.hs | 7 ++++--- src/Ide/Main.hs | 9 ++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ghcide/exe/Main.hs b/ghcide/exe/Main.hs index 482616011f2..1fa77aaec0c 100644 --- a/ghcide/exe/Main.hs +++ b/ghcide/exe/Main.hs @@ -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 @@ -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 diff --git a/src/Ide/Main.hs b/src/Ide/Main.hs index 116cf89df4e..3516ecf837e 100644 --- a/src/Ide/Main.hs +++ b/src/Ide/Main.hs @@ -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) @@ -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