From 82bfab383451770bccda63ca1794b15726e90ab8 Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Wed, 17 Aug 2022 23:48:44 +0200 Subject: [PATCH 1/2] Fix --testing Fix the --testing flag for HLS to correctly link the ghcide test plugin --- src/Ide/Main.hs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Ide/Main.hs b/src/Ide/Main.hs index a5a5acd594..bd529e96fd 100644 --- a/src/Ide/Main.hs +++ b/src/Ide/Main.hs @@ -122,16 +122,15 @@ runLspMode recorder ghcideArgs@GhcideArguments{..} idePlugins = withTelemetryLog -- exists so old-style logging works. intended to be phased out let logger = Logger $ \p m -> logger_ recorder (WithPriority p emptyCallStack $ LogOther m) + args = (if argsTesting then IDEMain.testing else IDEMain.defaultArguments) + (cmapWithPrio LogIDEMain recorder) logger - IDEMain.defaultMain (cmapWithPrio LogIDEMain recorder) (IDEMain.defaultArguments (cmapWithPrio LogIDEMain recorder) logger) + IDEMain.defaultMain (cmapWithPrio LogIDEMain recorder) args { IDEMain.argCommand = argsCommand - , IDEMain.argsHlsPlugins = idePlugins + , IDEMain.argsHlsPlugins = IDEMain.argsHlsPlugins args <> idePlugins , IDEMain.argsLogger = pure logger <> pure telemetryLogger , IDEMain.argsThreads = if argsThreads == 0 then Nothing else Just $ fromIntegral argsThreads , IDEMain.argsIdeOptions = \_config sessionLoader -> let defOptions = Ghcide.defaultIdeOptions sessionLoader - in defOptions - { Ghcide.optShakeProfiling = argsShakeProfiling - , Ghcide.optTesting = Ghcide.IdeTesting argsTesting - } + in defOptions { Ghcide.optShakeProfiling = argsShakeProfiling } } From 47d896c3a508e813210fcc850b1d5489ff2af6af Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Fri, 19 Aug 2022 18:43:34 +0200 Subject: [PATCH 2/2] fix ghcide options --- src/Ide/Main.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ide/Main.hs b/src/Ide/Main.hs index bd529e96fd..92bedba4fa 100644 --- a/src/Ide/Main.hs +++ b/src/Ide/Main.hs @@ -130,7 +130,7 @@ runLspMode recorder ghcideArgs@GhcideArguments{..} idePlugins = withTelemetryLog , IDEMain.argsHlsPlugins = IDEMain.argsHlsPlugins args <> idePlugins , IDEMain.argsLogger = pure logger <> pure telemetryLogger , IDEMain.argsThreads = if argsThreads == 0 then Nothing else Just $ fromIntegral argsThreads - , IDEMain.argsIdeOptions = \_config sessionLoader -> - let defOptions = Ghcide.defaultIdeOptions sessionLoader + , IDEMain.argsIdeOptions = \config sessionLoader -> + let defOptions = IDEMain.argsIdeOptions args config sessionLoader in defOptions { Ghcide.optShakeProfiling = argsShakeProfiling } }