Skip to content

Commit bf7fff1

Browse files
wenytang-msCopilot
andcommitted
fix: drop unused legacy env var cleanup per review feedback
JAVA_TOOL_OPTIONS has never been written to the per-extension EnvironmentVariableCollection by this codebase (verified via 'git log -S JAVA_TOOL_OPTIONS'). The legacy cleanup loop was therefore dead code, and could be misread as touching user-managed env vars (it cannot — the collection is per-extension and only sees mutators this extension wrote). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 05b2ced commit bf7fff1

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

src/noConfigDebugInit.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@ import * as vscode from 'vscode';
99
import { sendInfo, sendError } from "vscode-extension-telemetry-wrapper";
1010
import { getJavaHome } from "./utility";
1111
import { buildNoConfigPathAppendValue } from "./pathUtil";
12-
import { applyAppendIfChanged, applyReplaceIfChanged, deleteIfPresent } from "./envVarSync";
13-
14-
// Environment variables that older versions of this extension contributed but
15-
// no longer manage. They are cleaned up explicitly on activation so they do
16-
// not linger in the persistent EnvironmentVariableCollection. See issue #1647.
17-
const LEGACY_ENV_VARS = ["JAVA_TOOL_OPTIONS"];
12+
import { applyAppendIfChanged, applyReplaceIfChanged } from "./envVarSync";
1813

1914
const ENV_VAR_COLLECTION_DESCRIPTION = "Java No-Config Debug";
2015

@@ -83,13 +78,6 @@ export async function registerNoConfigDebug(
8378
collection.description = ENV_VAR_COLLECTION_DESCRIPTION;
8479
}
8580

86-
// Remove any variables that older versions of this extension used to set
87-
// but no longer manage. Doing this idempotently (only when present) keeps
88-
// subsequent reloads from triggering the "restart terminal" prompt.
89-
for (const legacy of LEGACY_ENV_VARS) {
90-
deleteIfPresent(collection, legacy);
91-
}
92-
9381
// Apply our managed variables using diff-aware helpers. On a typical
9482
// window reload the values are unchanged and these calls are no-ops, so
9583
// VS Code does not prompt the user to restart their existing terminals.

0 commit comments

Comments
 (0)