@@ -11,11 +11,11 @@ import { PTVSD_PATH } from '../Common/constants';
1111import { DebugOptions , IDebugServer , IPythonProcess , LaunchRequestArguments } from '../Common/Contracts' ;
1212import { IS_WINDOWS } from '../Common/Utils' ;
1313import { BaseDebugServer } from '../DebugServers/BaseDebugServer' ;
14- import { LocalDebugServer } from '../DebugServers/LocalDebugServer' ;
1514import { LocalDebugServerV2 } from '../DebugServers/LocalDebugServerV2' ;
1615import { IDebugLauncherScriptProvider } from '../types' ;
1716import { DebugClient , DebugType } from './DebugClient' ;
1817import { DebugClientHelper } from './helper' ;
18+ import { noop } from '../../common/core.utils' ;
1919
2020const VALID_DEBUG_OPTIONS = [
2121 'RedirectOutput' ,
@@ -48,14 +48,8 @@ export class LocalDebugClient extends DebugClient<LaunchRequestArguments> {
4848 super ( args , debugSession ) ;
4949 }
5050
51- public CreateDebugServer ( pythonProcess ?: IPythonProcess , serviceContainer ?: IServiceContainer ) : BaseDebugServer {
52- if ( this . args . type === 'pythonExperimental' ) {
53- this . debugServer = new LocalDebugServerV2 ( this . debugSession , this . args , serviceContainer ! ) ;
54- } else {
55- this . pythonProcess = pythonProcess ! ;
56- this . debugServer = new LocalDebugServer ( this . debugSession , this . pythonProcess ! , this . args ) ;
57- }
58- return this . debugServer ;
51+ public CreateDebugServer ( _pythonProcess ?: IPythonProcess , serviceContainer ?: IServiceContainer ) : BaseDebugServer {
52+ return new LocalDebugServerV2 ( this . debugSession , this . args , serviceContainer ! ) ;
5953 }
6054
6155 public get DebugType ( ) : DebugType {
@@ -86,10 +80,8 @@ export class LocalDebugClient extends DebugClient<LaunchRequestArguments> {
8680 const environmentVariablesService = new EnvironmentVariablesService ( pathUtils ) ;
8781 const helper = new DebugClientHelper ( environmentVariablesService , pathUtils , currentProcess ) ;
8882 const environmentVariables = await helper . getEnvironmentVariables ( this . args ) ;
89- if ( this . args . type === 'pythonExperimental' ) {
90- // Import the PTVSD debugger, allowing users to use their own latest copies.
91- environmentVariablesService . appendPythonPath ( environmentVariables , PTVSD_PATH ) ;
92- }
83+ // Import the PTVSD debugger, allowing users to use their own latest copies.
84+ environmentVariablesService . appendPythonPath ( environmentVariables , PTVSD_PATH ) ;
9385 // tslint:disable-next-line:max-func-body-length cyclomatic-complexity no-any
9486 return new Promise < any > ( ( resolve , reject ) => {
9587 const fileDir = this . args && this . args . program ? path . dirname ( this . args . program ) : '' ;
@@ -138,19 +130,7 @@ export class LocalDebugClient extends DebugClient<LaunchRequestArguments> {
138130 this . displayError ( error ) ;
139131 } ) ;
140132 proc . stderr . setEncoding ( 'utf8' ) ;
141- proc . stderr . on ( 'data' , error => {
142- if ( this . args . type === 'pythonExperimental' ) {
143- return ;
144- }
145- // We generally don't need to display the errors as stderr output is being captured by debugger
146- // and it gets sent out to the debug client.
147-
148- // Either way, we need some code in here so we read the stdout of the python process,
149- // Else it just keep building up (related to issue #203 and #52).
150- if ( this . debugServerStatus === DebugServerStatus . NotRunning ) {
151- return failedToLaunch ( error ) ;
152- }
153- } ) ;
133+ proc . stderr . on ( 'data' , noop ) ;
154134 proc . stdout . on ( 'data' , d => {
155135 // This is necessary so we read the stdout of the python process,
156136 // Else it just keep building up (related to issue #203 and #52).
0 commit comments