4
4
5
5
'use strict' ;
6
6
7
- import { inject , injectable } from 'inversify' ;
8
7
import * as path from 'path' ;
9
8
import {
10
9
DebugAdapterDescriptor ,
@@ -31,9 +30,8 @@ export enum debugStateKeys {
31
30
doNotShowAgain = 'doNotShowPython36DebugDeprecatedAgain' ,
32
31
}
33
32
34
- @injectable ( )
35
33
export class DebugAdapterDescriptorFactory implements IDebugAdapterDescriptorFactory {
36
- constructor ( @ inject ( IPersistentStateFactory ) private persistentState : IPersistentStateFactory ) { }
34
+ constructor ( ) { }
37
35
38
36
public async createDebugAdapterDescriptor (
39
37
session : DebugSession ,
@@ -140,45 +138,43 @@ export class DebugAdapterDescriptorFactory implements IDebugAdapterDescriptorFac
140
138
return [ ] ;
141
139
}
142
140
143
- private async showDeprecatedPythonMessage ( ) {
144
- const notificationPromptEnabled = this . persistentState . createGlobalPersistentState (
145
- debugStateKeys . doNotShowAgain ,
146
- false ,
147
- ) ;
148
- if ( notificationPromptEnabled . value ) {
149
- return ;
150
- }
151
- const prompts = [ Interpreters . changePythonInterpreter , Common . doNotShowAgain ] ;
152
- const selection = await showErrorMessage (
153
- l10n . t ( 'The debugger in the python extension no longer supports python versions minor than 3.7.' ) ,
154
- { modal : true } ,
155
- ...prompts ,
156
- ) ;
157
- if ( ! selection ) {
158
- return ;
159
- }
160
- if ( selection === Interpreters . changePythonInterpreter ) {
161
- await runPythonExtensionCommand ( Commands . Set_Interpreter ) ;
162
- }
163
- if ( selection === Common . doNotShowAgain ) {
164
- // Never show the message again
165
- await this . persistentState
166
- . createGlobalPersistentState ( debugStateKeys . doNotShowAgain , false )
167
- . updateValue ( true ) ;
168
- }
169
- }
141
+ // private async showDeprecatedPythonMessage() {
142
+ // const notificationPromptEnabled = this.persistentState.createGlobalPersistentState(
143
+ // debugStateKeys.doNotShowAgain,
144
+ // false,
145
+ // );
146
+ // if (notificationPromptEnabled.value) {
147
+ // return;
148
+ // }
149
+ // const prompts = [Interpreters.changePythonInterpreter, Common.doNotShowAgain];
150
+ // const selection = await showErrorMessage(
151
+ // l10n.t('The debugger in the python extension no longer supports python versions minor than 3.7.'),
152
+ // { modal: true },
153
+ // ...prompts,
154
+ // );
155
+ // if (!selection) {
156
+ // return;
157
+ // }
158
+ // if (selection === Interpreters.changePythonInterpreter) {
159
+ // await runPythonExtensionCommand(Commands.Set_Interpreter);
160
+ // }
161
+ // if (selection === Common.doNotShowAgain) {
162
+ // // Never show the message again
163
+ // await this.persistentState
164
+ // .createGlobalPersistentState(debugStateKeys.doNotShowAgain, false)
165
+ // .updateValue(true);
166
+ // }
167
+ // }
170
168
171
169
private async getExecutableCommand ( interpreter : Environment | undefined ) : Promise < string [ ] > {
172
- const debugpyVersionPath = path . join ( EXTENSION_ROOT_DIR , 'pythonFiles' , 'get_debugpy_version.py' ) ;
173
-
174
-
175
170
if ( interpreter ) {
176
- if (
177
- ( interpreter . version ?. major ?? 0 ) < 3 ||
178
- ( ( interpreter . version ?. major ?? 0 ) <= 3 && ( interpreter . version ?. minor ?? 0 ) <= 6 )
179
- ) {
180
- this . showDeprecatedPythonMessage ( ) ;
181
- }
171
+ // This is going to be implemented later, in order to check the debugpy version
172
+ // if (
173
+ // (interpreter.version?.major ?? 0) < 3 ||
174
+ // ((interpreter.version?.major ?? 0) <= 3 && (interpreter.version?.minor ?? 0) <= 6)
175
+ // ) {
176
+ // this.showDeprecatedPythonMessage();
177
+ // }
182
178
return interpreter . path . length > 0 ? [ interpreter . path ] : [ ] ;
183
179
}
184
180
return [ ] ;
0 commit comments