Skip to content

Commit

Permalink
Use an error message instead of an information one
Browse files Browse the repository at this point in the history
  • Loading branch information
paulacamargo25 committed Nov 17, 2022
1 parent eb12028 commit a0c9e1f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/client/debugger/extension/adapter/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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,
Expand Down
5 changes: 1 addition & 4 deletions src/test/debugger/extension/adapter/factory.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ suite('Debugging - Adapter Factory', () => {
let stateFactory: IPersistentStateFactory;
let state: PersistentState<boolean | undefined>;
let showErrorMessageStub: sinon.SinonStub;
let showInformationMessageStub: sinon.SinonStub;

const nodeExecutable = undefined;
const debugAdapterPath = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'lib', 'python', 'debugpy', 'adapter');
Expand Down Expand Up @@ -70,7 +69,6 @@ suite('Debugging - Adapter Factory', () => {
state = mock(PersistentState) as PersistentState<boolean | undefined>;

showErrorMessageStub = sinon.stub(windowApis, 'showErrorMessage');
showInformationMessageStub = sinon.stub(windowApis, 'showInformationMessage');

when(
stateFactory.createGlobalPersistentState<boolean | undefined>(debugStateKeys.doNotShowAgain, false),
Expand Down Expand Up @@ -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' });
Expand Down

0 comments on commit a0c9e1f

Please sign in to comment.