From a0c9e1f35447aacedebdd8d671360141c5a7b904 Mon Sep 17 00:00:00 2001 From: Paula Camargo Date: Mon, 7 Nov 2022 12:11:29 -0800 Subject: [PATCH] Use an error message instead of an information one --- src/client/debugger/extension/adapter/factory.ts | 4 ++-- src/test/debugger/extension/adapter/factory.unit.test.ts | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/client/debugger/extension/adapter/factory.ts b/src/client/debugger/extension/adapter/factory.ts index 6c3fc7cf5b2f..f64b74d9faac 100644 --- a/src/client/debugger/extension/adapter/factory.ts +++ b/src/client/debugger/extension/adapter/factory.ts @@ -21,7 +21,7 @@ import { EventName } from '../../../telemetry/constants'; import { AttachRequestArguments, LaunchRequestArguments } from '../../types'; import { IDebugAdapterDescriptorFactory } from '../types'; import * as nls from 'vscode-nls'; -import { showErrorMessage, showInformationMessage } from '../../../common/vscodeApis/windowApis'; +import { showErrorMessage } from '../../../common/vscodeApis/windowApis'; import { Common } from '../../../common/utils/localize'; import { IPersistentStateFactory } from '../../../common/types'; @@ -161,7 +161,7 @@ export class DebugAdapterDescriptorFactory implements IDebugAdapterDescriptorFac return; } const prompts = [Common.doNotShowAgain]; - const selection = await showInformationMessage( + const selection = await showErrorMessage( 'The debugger in the python extension no longer supports python versions minor than 3.7.', { modal: true }, ...prompts, diff --git a/src/test/debugger/extension/adapter/factory.unit.test.ts b/src/test/debugger/extension/adapter/factory.unit.test.ts index b82f6fb7d113..def169a362cd 100644 --- a/src/test/debugger/extension/adapter/factory.unit.test.ts +++ b/src/test/debugger/extension/adapter/factory.unit.test.ts @@ -34,7 +34,6 @@ suite('Debugging - Adapter Factory', () => { let stateFactory: IPersistentStateFactory; let state: PersistentState; let showErrorMessageStub: sinon.SinonStub; - let showInformationMessageStub: sinon.SinonStub; const nodeExecutable = undefined; const debugAdapterPath = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'lib', 'python', 'debugpy', 'adapter'); @@ -70,7 +69,6 @@ suite('Debugging - Adapter Factory', () => { state = mock(PersistentState) as PersistentState; showErrorMessageStub = sinon.stub(windowApis, 'showErrorMessage'); - showInformationMessageStub = sinon.stub(windowApis, 'showInformationMessage'); when( stateFactory.createGlobalPersistentState(debugStateKeys.doNotShowAgain, false), @@ -162,12 +160,11 @@ suite('Debugging - Adapter Factory', () => { version: new SemVer('3.6.12-test'), }; when(state.value).thenReturn(false); - when(interpreterService.getActiveInterpreter(anything())).thenResolve(deprecatedInterpreter); await factory.createDebugAdapterDescriptor(session, nodeExecutable); - sinon.assert.calledOnce(showInformationMessageStub); + sinon.assert.calledOnce(showErrorMessageStub); }); test('Return Debug Adapter server if request is "attach", and port is specified directly', async () => { const session = createSession({ request: 'attach', port: 5678, host: 'localhost' });