Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/configurationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,6 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration

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

// Auto add '--enable-preview' vmArgs if the java project enables COMPILER_PB_ENABLE_PREVIEW_FEATURES flag.
if (await lsPlugin.detectPreviewFlag(config.mainClass, config.projectName)) {
config.vmArgs = (config.vmArgs || "") + " --enable-preview";
}

if (config.request === "launch" && (!config.shortenCommandLine || config.shortenCommandLine === "auto")) {
config.shortenCommandLine = await detectLaunchCommandStyle(config);
}
Expand Down