Skip to content

Commit

Permalink
Fix --testing (haskell#3113)
Browse files Browse the repository at this point in the history
* Fix --testing

Fix the --testing flag for HLS to correctly link the ghcide test plugin

* fix ghcide options
  • Loading branch information
pepeiborra authored and sloorush committed Sep 12, 2022
1 parent b2d7bab commit efaca25
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/Ide/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
, IDEMain.argsIdeOptions = \config sessionLoader ->
let defOptions = IDEMain.argsIdeOptions args config sessionLoader
in defOptions { Ghcide.optShakeProfiling = argsShakeProfiling }
}

0 comments on commit efaca25

Please sign in to comment.