Skip to content

Commit bbe8e49

Browse files
Fix bug: Cannot pass vmArgs array to Java 13 project (#705)
Signed-off-by: Jinbo Wang <[email protected]>
1 parent b900048 commit bbe8e49

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/configurationProvider.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,6 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
193193

194194
// Add the default launch options to the config.
195195
config.cwd = config.cwd || _.get(folder, "uri.fsPath");
196-
// Auto add '--enable-preview' vmArgs if the java project enables COMPILER_PB_ENABLE_PREVIEW_FEATURES flag.
197-
if (await lsPlugin.detectPreviewFlag(config.mainClass, config.projectName)) {
198-
config.vmArgs = (config.vmArgs || "") + " --enable-preview";
199-
}
200196
} else if (config.request === "attach") {
201197
if (!config.hostName || !config.port) {
202198
throw new utility.UserError({
@@ -221,6 +217,11 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
221217
config.vmArgs = this.concatArgs(config.vmArgs);
222218
}
223219

220+
// Auto add '--enable-preview' vmArgs if the java project enables COMPILER_PB_ENABLE_PREVIEW_FEATURES flag.
221+
if (await lsPlugin.detectPreviewFlag(config.mainClass, config.projectName)) {
222+
config.vmArgs = (config.vmArgs || "") + " --enable-preview";
223+
}
224+
224225
if (config.request === "launch" && (!config.shortenCommandLine || config.shortenCommandLine === "auto")) {
225226
config.shortenCommandLine = await detectLaunchCommandStyle(config);
226227
}

0 commit comments

Comments
 (0)