Skip to content

Commit 82bfab3

Browse files
committed
Fix --testing
Fix the --testing flag for HLS to correctly link the ghcide test plugin
1 parent 099b4e7 commit 82bfab3

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/Ide/Main.hs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,15 @@ runLspMode recorder ghcideArgs@GhcideArguments{..} idePlugins = withTelemetryLog
122122

123123
-- exists so old-style logging works. intended to be phased out
124124
let logger = Logger $ \p m -> logger_ recorder (WithPriority p emptyCallStack $ LogOther m)
125+
args = (if argsTesting then IDEMain.testing else IDEMain.defaultArguments)
126+
(cmapWithPrio LogIDEMain recorder) logger
125127

126-
IDEMain.defaultMain (cmapWithPrio LogIDEMain recorder) (IDEMain.defaultArguments (cmapWithPrio LogIDEMain recorder) logger)
128+
IDEMain.defaultMain (cmapWithPrio LogIDEMain recorder) args
127129
{ IDEMain.argCommand = argsCommand
128-
, IDEMain.argsHlsPlugins = idePlugins
130+
, IDEMain.argsHlsPlugins = IDEMain.argsHlsPlugins args <> idePlugins
129131
, IDEMain.argsLogger = pure logger <> pure telemetryLogger
130132
, IDEMain.argsThreads = if argsThreads == 0 then Nothing else Just $ fromIntegral argsThreads
131133
, IDEMain.argsIdeOptions = \_config sessionLoader ->
132134
let defOptions = Ghcide.defaultIdeOptions sessionLoader
133-
in defOptions
134-
{ Ghcide.optShakeProfiling = argsShakeProfiling
135-
, Ghcide.optTesting = Ghcide.IdeTesting argsTesting
136-
}
135+
in defOptions { Ghcide.optShakeProfiling = argsShakeProfiling }
137136
}

0 commit comments

Comments
 (0)