From 44e3345c64456070bf2aa37703a938abdb42d48f Mon Sep 17 00:00:00 2001 From: Georgii Ustinov Date: Thu, 26 Sep 2024 19:58:54 +0300 Subject: [PATCH] [Java] Update parser options so java command options are not treated as posix arguments IDEA-359564 GitOrigin-RevId: 287249e197bacb2452b44bd0b11286eadd5ba4ee --- .../intellij/java/terminal/JavaShellCommandSpecsProvider.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/java/java-terminal/src/com/intellij/java/terminal/JavaShellCommandSpecsProvider.kt b/java/java-terminal/src/com/intellij/java/terminal/JavaShellCommandSpecsProvider.kt index bd0c48cf0149..ca1cb405d912 100644 --- a/java/java-terminal/src/com/intellij/java/terminal/JavaShellCommandSpecsProvider.kt +++ b/java/java-terminal/src/com/intellij/java/terminal/JavaShellCommandSpecsProvider.kt @@ -5,6 +5,7 @@ import com.intellij.execution.vmOptions.VMOptionKind import com.intellij.execution.vmOptions.VMOptionVariant import com.intellij.execution.vmOptions.VMOptionsService import com.intellij.openapi.diagnostic.Logger +import com.intellij.terminal.completion.spec.ShellCommandParserOptions import com.intellij.terminal.completion.spec.ShellCommandSpec import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext @@ -18,6 +19,8 @@ class JavaShellCommandSpecsProvider : ShellCommandSpecsProvider { } private fun getSpecs(): ShellCommandSpec = ShellCommandSpec("java") { + parserOptions = ShellCommandParserOptions.create(flagsArePosixNonCompliant = true, optionsMustPrecedeArguments = true) + dynamicOptions { terminalContext -> val javaContext = JavaShellCommandContext.create(terminalContext) addOptionsFromVM(javaContext?.getJrePath())