From 5a13c1608a0bf3a8150ae715b8710cbba273dfc3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Oct 2025 22:20:34 +0000 Subject: [PATCH 1/3] Initial plan From a884a3522650a4fecf6fb5a635a40ea3c3653094 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Oct 2025 22:29:10 +0000 Subject: [PATCH 2/3] Change VS Code confirmation message to quick pick in interaction service Co-authored-by: adamint <20359921+adamint@users.noreply.github.com> --- extension/package-lock.json | 4 +-- extension/src/server/interactionService.ts | 13 +++++---- .../test/rpc/interactionServiceTests.test.ts | 28 +++++++++++++++++++ extension/yarn.lock | 6 ++-- 4 files changed, 40 insertions(+), 11 deletions(-) diff --git a/extension/package-lock.json b/extension/package-lock.json index 1da7f32d419..bca9234a0fb 100644 --- a/extension/package-lock.json +++ b/extension/package-lock.json @@ -1,12 +1,12 @@ { "name": "aspire-vscode", - "version": "0.3.0", + "version": "0.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "aspire-vscode", - "version": "0.3.0", + "version": "0.4.0", "license": "SEE LICENSE IN LICENSE.TXT", "dependencies": { "@vscode/extension-telemetry": "^1.0.0", diff --git a/extension/src/server/interactionService.ts b/extension/src/server/interactionService.ts index 924292420cd..ccdb32f9e0f 100644 --- a/extension/src/server/interactionService.ts +++ b/extension/src/server/interactionService.ts @@ -131,12 +131,13 @@ export class InteractionService implements IInteractionService { const yes = yesLabel; const no = noLabel; - const result = await vscode.window.showInformationMessage( - formatText(promptText), - { modal: true }, - yes, - no - ); + const choices = [yes, no]; + + const result = await vscode.window.showQuickPick(choices, { + placeHolder: formatText(promptText), + canPickMany: false, + ignoreFocusOut: true + }); if (result === yes) { return true; diff --git a/extension/src/test/rpc/interactionServiceTests.test.ts b/extension/src/test/rpc/interactionServiceTests.test.ts index f05e49f326b..fbc9e19ba3a 100644 --- a/extension/src/test/rpc/interactionServiceTests.test.ts +++ b/extension/src/test/rpc/interactionServiceTests.test.ts @@ -78,6 +78,34 @@ suite('InteractionService endpoints', () => { showInputBoxStub.restore(); }); + // confirm + test('confirm returns true when Yes is selected', async () => { + const testInfo = await createTestRpcServer(); + const showQuickPickStub = sinon.stub(vscode.window, 'showQuickPick').resolves('Yes' as any); + const result = await testInfo.interactionService.confirm('Are you sure?', true); + assert.strictEqual(result, true); + assert.ok(showQuickPickStub.calledOnce, 'showQuickPick should be called once'); + showQuickPickStub.restore(); + }); + + test('confirm returns false when No is selected', async () => { + const testInfo = await createTestRpcServer(); + const showQuickPickStub = sinon.stub(vscode.window, 'showQuickPick').resolves('No' as any); + const result = await testInfo.interactionService.confirm('Are you sure?', false); + assert.strictEqual(result, false); + assert.ok(showQuickPickStub.calledOnce, 'showQuickPick should be called once'); + showQuickPickStub.restore(); + }); + + test('confirm returns null when cancelled', async () => { + const testInfo = await createTestRpcServer(); + const showQuickPickStub = sinon.stub(vscode.window, 'showQuickPick').resolves(undefined); + const result = await testInfo.interactionService.confirm('Are you sure?', true); + assert.strictEqual(result, null); + assert.ok(showQuickPickStub.calledOnce, 'showQuickPick should be called once'); + showQuickPickStub.restore(); + }); + test('displayError endpoint', async () => { const testInfo = await createTestRpcServer(); const showErrorMessageSpy = sinon.spy(vscode.window, 'showErrorMessage'); diff --git a/extension/yarn.lock b/extension/yarn.lock index b8d65f2d611..ec7851d07e7 100644 --- a/extension/yarn.lock +++ b/extension/yarn.lock @@ -1006,10 +1006,10 @@ ora "^8.1.0" semver "^7.6.2" -"@vscode/vsce-sign-win32-x64@2.0.2": +"@vscode/vsce-sign-linux-x64@2.0.2": version "2.0.2" - resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@vscode/vsce-sign-win32-x64/-/vsce-sign-win32-x64-2.0.2.tgz" - integrity sha1-KU6nK0T+3WlNSfXO9MVb84dtwlc= + resolved "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@vscode/vsce-sign-linux-x64/-/vsce-sign-linux-x64-2.0.2.tgz" + integrity sha1-WauT8yLvs89JFm1OLoEnicMRdCg= "@vscode/vsce-sign@^2.0.0": version "2.0.5" From db3dd5e324ab3a4e87750164a89a44db39b4f037 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Oct 2025 22:32:46 +0000 Subject: [PATCH 3/3] Enhance confirm test to verify showQuickPick options Co-authored-by: adamint <20359921+adamint@users.noreply.github.com> --- extension/src/test/rpc/interactionServiceTests.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/extension/src/test/rpc/interactionServiceTests.test.ts b/extension/src/test/rpc/interactionServiceTests.test.ts index fbc9e19ba3a..b26097994c0 100644 --- a/extension/src/test/rpc/interactionServiceTests.test.ts +++ b/extension/src/test/rpc/interactionServiceTests.test.ts @@ -85,6 +85,13 @@ suite('InteractionService endpoints', () => { const result = await testInfo.interactionService.confirm('Are you sure?', true); assert.strictEqual(result, true); assert.ok(showQuickPickStub.calledOnce, 'showQuickPick should be called once'); + + // Verify options passed to showQuickPick + const callArgs = showQuickPickStub.getCall(0).args; + assert.deepStrictEqual(callArgs[0], ['Yes', 'No'], 'should show Yes and No choices'); + assert.strictEqual(callArgs[1]?.canPickMany, false, 'canPickMany should be false'); + assert.strictEqual(callArgs[1]?.ignoreFocusOut, true, 'ignoreFocusOut should be true'); + showQuickPickStub.restore(); });