@@ -6,7 +6,7 @@ module Development.IDE.Main
6
6
,isLSP
7
7
,commandP
8
8
,defaultMain
9
- ) where
9
+ ,testing ) where
10
10
import Control.Concurrent.Extra (newLock , readVar ,
11
11
withLock ,
12
12
withNumCapabilities )
@@ -55,6 +55,7 @@ import Development.IDE.LSP.LanguageServer (runLanguageServer)
55
55
import Development.IDE.Plugin (Plugin (pluginHandlers , pluginModifyDynflags , pluginRules ))
56
56
import Development.IDE.Plugin.HLS (asGhcIdePlugin )
57
57
import qualified Development.IDE.Plugin.HLS.GhcIde as Ghcide
58
+ import qualified Development.IDE.Plugin.Test as Test
58
59
import Development.IDE.Session (SessionLoadingOptions ,
59
60
getHieDbLoc ,
60
61
loadSessionWithOptions ,
@@ -65,9 +66,11 @@ import Development.IDE.Types.Location (NormalizedUri,
65
66
import Development.IDE.Types.Logger (Logger (Logger ))
66
67
import Development.IDE.Types.Options (IdeGhcSession ,
67
68
IdeOptions (optCheckParents , optCheckProject , optReportProgress , optRunSubset ),
69
+ IdeTesting (IdeTesting ),
68
70
clientSupportsProgress ,
69
71
defaultIdeOptions ,
70
- optModifyDynFlags )
72
+ optModifyDynFlags ,
73
+ optTesting )
71
74
import Development.IDE.Types.Shake (Key (Key ))
72
75
import GHC.Conc (getNumProcessors )
73
76
import GHC.IO.Encoding (setLocaleEncoding )
@@ -81,6 +84,7 @@ import Ide.Plugin.ConfigUtils (pluginsToDefaultConfig,
81
84
pluginsToVSCodeExtensionSchema )
82
85
import Ide.PluginUtils (allLspCmdIds' ,
83
86
getProcessID ,
87
+ idePluginsToPluginDesc ,
84
88
pluginDescToIdePlugins )
85
89
import Ide.Types (IdeCommand (IdeCommand ),
86
90
IdePlugins ,
@@ -201,6 +205,18 @@ instance Default Arguments where
201
205
return newStdout
202
206
}
203
207
208
+ testing :: Arguments
209
+ testing = def {
210
+ argsHlsPlugins = pluginDescToIdePlugins $
211
+ idePluginsToPluginDesc (argsHlsPlugins def)
212
+ ++ [Test. blockCommandDescriptor " block-command" , Test. plugin],
213
+ argsIdeOptions = \ config sessionLoader ->
214
+ let defOptions = argsIdeOptions def config sessionLoader
215
+ in defOptions {
216
+ optTesting = IdeTesting True
217
+ }
218
+ }
219
+
204
220
-- | Cheap stderr logger that relies on LineBuffering
205
221
stderrLogger :: IO Logger
206
222
stderrLogger = do
0 commit comments