From 95032100a48a5bfa38af009485265d276c03189e Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Sun, 13 Nov 2022 19:00:15 +0100 Subject: [PATCH] Fix minimum capabilities --- ghcide/src/Development/IDE/Main.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ghcide/src/Development/IDE/Main.hs b/ghcide/src/Development/IDE/Main.hs index fbbd5a88a6..45a9484a56 100644 --- a/ghcide/src/Development/IDE/Main.hs +++ b/ghcide/src/Development/IDE/Main.hs @@ -318,9 +318,10 @@ defaultMain recorder Arguments{..} = withHeapStats (cmapWithPrio LogHeapStats re outH <- argsHandleOut numProcessors <- getNumProcessors + let numCapabilities = max 1 $ maybe (numProcessors `div` 2) fromIntegral argsThreads case argCommand of - LSP -> withNumCapabilities (maybe (numProcessors `div` 2) fromIntegral argsThreads) $ do + LSP -> withNumCapabilities numCapabilities $ do t <- offsetTime log Info $ LogLspStart (pluginId <$> ipMap argsHlsPlugins)