@@ -15,7 +15,7 @@ import {
1515import { IApplicationShell } from '../../../common/application/types' ;
1616import { EXTENSION_ROOT_DIR } from '../../../constants' ;
1717import { IInterpreterService } from '../../../interpreter/contracts' ;
18- import { traceVerbose } from '../../../logging' ;
18+ import { traceLog , traceVerbose } from '../../../logging' ;
1919import { Conda } from '../../../pythonEnvironments/common/environmentManagers/conda' ;
2020import { EnvironmentType , PythonEnvironment } from '../../../pythonEnvironments/info' ;
2121import { sendTelemetryEvent } from '../../../telemetry' ;
@@ -49,8 +49,14 @@ export class DebugAdapterDescriptorFactory implements IDebugAdapterDescriptorFac
4949
5050 if ( configuration . request === 'attach' ) {
5151 if ( configuration . connect !== undefined ) {
52+ traceLog (
53+ `Connecting to DAP Server at: ${ configuration . connect . host ?? '127.0.0.1' } :${
54+ configuration . connect . port
55+ } `,
56+ ) ;
5257 return new DebugAdapterServer ( configuration . connect . port , configuration . connect . host ?? '127.0.0.1' ) ;
5358 } else if ( configuration . port !== undefined ) {
59+ traceLog ( `Connecting to DAP Server at: ${ configuration . host ?? '127.0.0.1' } :${ configuration . port } ` ) ;
5460 return new DebugAdapterServer ( configuration . port , configuration . host ?? '127.0.0.1' ) ;
5561 } else if ( configuration . listen === undefined && configuration . processId === undefined ) {
5662 throw new Error ( '"request":"attach" requires either "connect", "listen", or "processId"' ) ;
@@ -70,10 +76,9 @@ export class DebugAdapterDescriptorFactory implements IDebugAdapterDescriptorFac
7076 const logArgs = configuration . logToFile ? [ '--log-dir' , EXTENSION_ROOT_DIR ] : [ ] ;
7177
7278 if ( configuration . debugAdapterPath !== undefined ) {
73- return new DebugAdapterExecutable (
74- executable ,
75- command . concat ( [ configuration . debugAdapterPath , ...logArgs ] ) ,
76- ) ;
79+ const args = command . concat ( [ configuration . debugAdapterPath , ...logArgs ] ) ;
80+ traceLog ( `DAP Server launched with command: ${ executable } ${ args . join ( ' ' ) } ` ) ;
81+ return new DebugAdapterExecutable ( executable , args ) ;
7782 }
7883
7984 const debuggerAdapterPathToUse = path . join (
@@ -85,8 +90,10 @@ export class DebugAdapterDescriptorFactory implements IDebugAdapterDescriptorFac
8590 'adapter' ,
8691 ) ;
8792
93+ const args = command . concat ( [ debuggerAdapterPathToUse , ...logArgs ] ) ;
94+ traceLog ( `DAP Server launched with command: ${ executable } ${ args . join ( ' ' ) } ` ) ;
8895 sendTelemetryEvent ( EventName . DEBUG_ADAPTER_USING_WHEELS_PATH , undefined , { usingWheels : true } ) ;
89- return new DebugAdapterExecutable ( executable , command . concat ( [ debuggerAdapterPathToUse , ... logArgs ] ) ) ;
96+ return new DebugAdapterExecutable ( executable , args ) ;
9097 }
9198
9299 // Unlikely scenario.
@@ -136,10 +143,16 @@ export class DebugAdapterDescriptorFactory implements IDebugAdapterDescriptorFac
136143 return this . getExecutableCommand ( interpreters [ 0 ] ) ;
137144 }
138145
146+ private async getCondaCommand ( ) : Promise < Conda | undefined > {
147+ const condaCommand = await Conda . getConda ( ) ;
148+ const isCondaRunSupported = await condaCommand ?. isCondaRunSupported ( ) ;
149+ return isCondaRunSupported ? condaCommand : undefined ;
150+ }
151+
139152 private async getExecutableCommand ( interpreter : PythonEnvironment | undefined ) : Promise < string [ ] > {
140153 if ( interpreter ) {
141154 if ( interpreter . envType === EnvironmentType . Conda ) {
142- const condaCommand = await Conda . getConda ( ) ;
155+ const condaCommand = await this . getCondaCommand ( ) ;
143156 if ( condaCommand ) {
144157 if ( interpreter . envName ) {
145158 return [
0 commit comments