diff --git a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/AssertFindUsagesEntryCommand.kt b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/AssertFindUsagesEntryCommand.kt index 3169e3c9703e..97856aca22fe 100644 --- a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/AssertFindUsagesEntryCommand.kt +++ b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/AssertFindUsagesEntryCommand.kt @@ -25,7 +25,7 @@ class AssertFindUsagesEntryCommand(text: String, line: Int) : PlaybackCommandCor } val options = AssertFindUsagesEntryArguments() - Args.parse(options, extractCommandArgument(PREFIX).split("|").flatMap { it.split(" ", limit= 2) }.toTypedArray()) + Args.parse(options, extractCommandArgument(PREFIX).split("|").flatMap { it.split(" ", limit = 2) }.toTypedArray(), false) if (options.text == null && options.filePath == null) { throw IllegalStateException("Provide expected test or position of the find usages option.") diff --git a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/AssertModuleJdkVersionCommand.kt b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/AssertModuleJdkVersionCommand.kt index deba7fd9f62b..b68cd8a091cd 100644 --- a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/AssertModuleJdkVersionCommand.kt +++ b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/AssertModuleJdkVersionCommand.kt @@ -21,7 +21,7 @@ class AssertModuleJdkVersionCommand(text: String, line: Int) : PerformanceComman val project = context.project val options = AssertModuleJdkArguments() - Args.parse(options, extractCommandArgument(PREFIX).split("|").flatMap { it.split("=") }.toTypedArray()) + Args.parse(options, extractCommandArgument(PREFIX).split("|").flatMap { it.split("=") }.toTypedArray(), false) val moduleManager = ModuleManager.getInstance(project) val module = moduleManager.findModuleByName(options.moduleName) diff --git a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/FindUsagesCommand.kt b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/FindUsagesCommand.kt index 0efcfe54b821..a75dde070d1d 100644 --- a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/FindUsagesCommand.kt +++ b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/FindUsagesCommand.kt @@ -68,7 +68,7 @@ class FindUsagesCommand(text: String, line: Int) : PerformanceCommandCoroutineAd override suspend fun doExecute(context: PlaybackContext) { val options = FindUsagesArguments() - Args.parse(options, extractCommandArgument(PREFIX).split("|").flatMap { it.split(" ", limit = 2) }.toTypedArray()) + Args.parse(options, extractCommandArgument(PREFIX).split("|").flatMap { it.split(" ", limit = 2) }.toTypedArray(), false) val project = context.project val position = options.position diff --git a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/FindUsagesInBackgroundCommand.kt b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/FindUsagesInBackgroundCommand.kt index 44c92d12f795..3775ea580990 100644 --- a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/FindUsagesInBackgroundCommand.kt +++ b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/FindUsagesInBackgroundCommand.kt @@ -37,7 +37,7 @@ class FindUsagesInBackgroundCommand(text: String, line: Int) : PerformanceComman override suspend fun doExecute(context: PlaybackContext) { val options = FindUsagesArguments() - Args.parse(options, extractCommandArgument(PREFIX).split("|").flatMap { it.split(" ", limit = 2) }.toTypedArray()) + Args.parse(options, extractCommandArgument(PREFIX).split("|").flatMap { it.split(" ", limit = 2) }.toTypedArray(), false) val project = context.project val elementName = options.expectedName diff --git a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/InspectionCommandEx.java b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/InspectionCommandEx.java index 8caa8635901a..9a98f811b7eb 100644 --- a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/InspectionCommandEx.java +++ b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/InspectionCommandEx.java @@ -73,7 +73,7 @@ public class InspectionCommandEx extends AbstractCommand { public InspectionCommandEx(@NotNull String text, int line) { super(text, line); if (text.startsWith(PREFIX)) { - Args.parse(myOptions, text.substring(PREFIX.length()).trim().split(" ")); + Args.parse(myOptions, text.substring(PREFIX.length()).trim().split(" "), false); } } diff --git a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/OpenFileCommand.kt b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/OpenFileCommand.kt index 2229d3f33a75..03a973fa9bd3 100644 --- a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/OpenFileCommand.kt +++ b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/OpenFileCommand.kt @@ -49,7 +49,7 @@ class OpenFileCommand(text: String, line: Int) : PerformanceCommandCoroutineAdap fun getOptions(arguments: String): OpenFileCommandOptions? { return runCatching { - OpenFileCommandOptions().apply { Args.parse(this, arguments.split(" ").toTypedArray()) } + OpenFileCommandOptions().apply { Args.parse(this, arguments.split(" ").toTypedArray(), false) } }.getOrNull() } } diff --git a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/ReplaceTextCommand.java b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/ReplaceTextCommand.java index 31b824ebfcad..f1fe5519d0bd 100644 --- a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/ReplaceTextCommand.java +++ b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/ReplaceTextCommand.java @@ -35,7 +35,7 @@ public class ReplaceTextCommand extends AbstractCommand { protected @NotNull Promise _execute(@NotNull PlaybackContext context) { final AsyncPromise result = new AsyncPromise<>(); Options options = new Options(); - Args.parse(options, extractCommandArgument(PREFIX).split(" ")); + Args.parse(options, extractCommandArgument(PREFIX).split(" "), false); ApplicationManager.getApplication().executeOnPooledThread(() -> { try { diff --git a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/RunConfigurationCommand.java b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/RunConfigurationCommand.java index 9150f58919e9..ec244f3a9788 100644 --- a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/RunConfigurationCommand.java +++ b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/RunConfigurationCommand.java @@ -58,7 +58,7 @@ public final class RunConfigurationCommand extends AbstractCommand { //example: %runConfiguration -mode=TILL_TERMINATED|-configurationName=My Run Configuration|-failureExpected|-debug RunConfigurationOptions options = new RunConfigurationOptions(); Args.parse(options, Arrays.stream(extractCommandArgument(PREFIX).split("\\|")) - .flatMap(item -> Arrays.stream(item.split("="))).toArray(String[]::new)); + .flatMap(item -> Arrays.stream(item.split("="))).toArray(String[]::new), false); Ref mainSpan = new Ref<>(), processSpan = new Ref<>(); Timer timer = new Timer(); diff --git a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/SearchEverywhereCommand.java b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/SearchEverywhereCommand.java index 08c4c52734e1..1599af8891e7 100644 --- a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/SearchEverywhereCommand.java +++ b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/SearchEverywhereCommand.java @@ -267,7 +267,7 @@ public class SearchEverywhereCommand extends AbstractCommand { protected String @NotNull [] getArgs(String prefix) { String input = extractCommandArgument(prefix); String[] args = input.split("\\|"); - Args.parse(myOptions, args[0].split(" ")); + Args.parse(myOptions, args[0].split(" "), false); return args; } diff --git a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/SetModuleJdkCommand.kt b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/SetModuleJdkCommand.kt index e6d5a6a1055a..9210fa55757e 100644 --- a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/SetModuleJdkCommand.kt +++ b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/SetModuleJdkCommand.kt @@ -21,7 +21,7 @@ class SetModuleJdkCommand(text: String, line: Int) : PerformanceCommandCoroutine override suspend fun doExecute(context: PlaybackContext) { val project = context.project val options = SetModuleJdkArguments() - Args.parse(options, extractCommandArgument(PREFIX).split("|").flatMap { it.split("=") }.toTypedArray()) + Args.parse(options, extractCommandArgument(PREFIX).split("|").flatMap { it.split("=") }.toTypedArray(), false) val moduleManager = ModuleManager.getInstance(project) val module = moduleManager.findModuleByName(options.moduleName) diff --git a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/utils/CommandArgumentsExtensions.kt b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/utils/CommandArgumentsExtensions.kt index 1e79a4edaa48..053fae822252 100644 --- a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/utils/CommandArgumentsExtensions.kt +++ b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/utils/CommandArgumentsExtensions.kt @@ -4,5 +4,5 @@ import com.jetbrains.performancePlugin.commands.CommandArguments import com.sampullara.cli.Args fun CommandArguments.parse(text: String) { - Args.parse(this, text.split("|").flatMap { it.split(" ", limit=2) }.toTypedArray()) + Args.parse(this, text.split("|").flatMap { it.split(" ", limit = 2) }.toTypedArray(), false) } diff --git a/plugins/performanceTesting/core/testSrc/com/jetbrains/performancePlugin/commands/OpenFileCommandOptionsTest.kt b/plugins/performanceTesting/core/testSrc/com/jetbrains/performancePlugin/commands/OpenFileCommandOptionsTest.kt index 1c26b62d8226..138af230764a 100644 --- a/plugins/performanceTesting/core/testSrc/com/jetbrains/performancePlugin/commands/OpenFileCommandOptionsTest.kt +++ b/plugins/performanceTesting/core/testSrc/com/jetbrains/performancePlugin/commands/OpenFileCommandOptionsTest.kt @@ -19,7 +19,7 @@ class OpenFileCommandOptionsTest { fun testThat_Options_Successfully_Parsed(commandLine: String) { //Related to OpenFileCommand logic val myOptions = runCatching { - OpenFileCommandOptions().apply { Args.parse(this, commandLine.split(" ").toTypedArray()) } + OpenFileCommandOptions().apply { Args.parse(this, commandLine.split(" ").toTypedArray(), false) } }.getOrNull() assertTrue(myOptions!!.suppressErrors) @@ -32,7 +32,7 @@ class OpenFileCommandOptionsTest { fun testThat_DisableCodeAnalysis_is_False_ByDefault() { //Related to OpenFileCommand logic val myOptions = runCatching { - OpenFileCommandOptions().apply { Args.parse(this, "-file src/Main.java -suppressErrors -timeout 99".split(" ").toTypedArray()) } + OpenFileCommandOptions().apply { Args.parse(this, "-file src/Main.java -suppressErrors -timeout 99".split(" ").toTypedArray(), false) } }.getOrNull() assertFalse(myOptions!!.disableCodeAnalysis)