From 82fe820060bfd3fac705b5840ebe660146252f22 Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Mon, 26 Oct 2026 02:32:00 +0800 Subject: [PATCH] fix(setup): retain explicitly selected ILSpy paths --- .../SetupRegistrationEnvironment.ts | 1 + src/setupEnvironment.test.ts | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/application/SetupRegistrationEnvironment.ts b/src/application/SetupRegistrationEnvironment.ts index a08ded1798..6d5c96d03f 100644 --- a/src/application/SetupRegistrationEnvironment.ts +++ b/src/application/SetupRegistrationEnvironment.ts @@ -2,6 +2,7 @@ import type { DoctorProviderInspection } from "./Doctor.js"; import { compareUnicodeCodePoints } from "../domain/unicodeCodePointOrder.js"; const SELECTED_REGISTRATION_SETTINGS = [ + "REA_ILSPY_CMD_PATH", "REA_ANALYSIS_PROVIDER", "REA_ASAR_MAX_HEADER_BYTES", "REA_BRIDGE_MAX_REQUEST_BYTES", diff --git a/src/setupEnvironment.test.ts b/src/setupEnvironment.test.ts index 21ebeb268c..93e9917dca 100644 --- a/src/setupEnvironment.test.ts +++ b/src/setupEnvironment.test.ts @@ -23,6 +23,29 @@ import { snapshotEnvironment } from "./process/snapshotEnvironment.js"; afterEach(() => vi.unstubAllEnvs()); +it.each([undefined, "/caller/tools with spaces/ilspycmd"])( + "preserves the explicit ILSpy path %s without inventing an unset value", + async (selected) => { + const host = systemSetupHost( + createDoctorHostFixture({ + ...(selected === undefined ? {} : { configuredIlspyCmdPath: selected }), + ilspyCmdVersion: async () => "ilspycmd 9.1.0", + }), + selected === undefined ? {} : { REA_ILSPY_CMD_PATH: selected }, + ); + try { + const state = await host.initialSetupState(); + expect(state.providerEnvironment.REA_ILSPY_CMD_PATH).toBe(selected); + if (selected !== undefined) + expect(state.doctor.checks).toContainEqual( + expect.objectContaining({ name: "ilspycmd", ok: true }), + ); + } finally { + await host.close?.(); + } + }, +); + it("plans setup and uninstall against selected home and client overrides", async () => { const root = await mkdtemp(join(tmpdir(), "rea-selected-setup-")); const environment = {