Skip to content

Commit efaca25

Browse files
pepeiborrasloorush
authored andcommitted
Fix --testing (haskell#3113)
* Fix --testing Fix the --testing flag for HLS to correctly link the ghcide test plugin * fix ghcide options
1 parent b2d7bab commit efaca25

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/Ide/Main.hs

+7-8
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
131-
, IDEMain.argsIdeOptions = \_config sessionLoader ->
132-
let defOptions = Ghcide.defaultIdeOptions sessionLoader
133-
in defOptions
134-
{ Ghcide.optShakeProfiling = argsShakeProfiling
135-
, Ghcide.optTesting = Ghcide.IdeTesting argsTesting
136-
}
133+
, IDEMain.argsIdeOptions = \config sessionLoader ->
134+
let defOptions = IDEMain.argsIdeOptions args config sessionLoader
135+
in defOptions { Ghcide.optShakeProfiling = argsShakeProfiling }
137136
}

0 commit comments

Comments
 (0)