@@ -15,7 +15,7 @@ import {
15
15
import { IApplicationShell } from '../../../common/application/types' ;
16
16
import { EXTENSION_ROOT_DIR } from '../../../constants' ;
17
17
import { IInterpreterService } from '../../../interpreter/contracts' ;
18
- import { traceVerbose } from '../../../logging' ;
18
+ import { traceLog , traceVerbose } from '../../../logging' ;
19
19
import { Conda } from '../../../pythonEnvironments/common/environmentManagers/conda' ;
20
20
import { EnvironmentType , PythonEnvironment } from '../../../pythonEnvironments/info' ;
21
21
import { sendTelemetryEvent } from '../../../telemetry' ;
@@ -49,8 +49,14 @@ export class DebugAdapterDescriptorFactory implements IDebugAdapterDescriptorFac
49
49
50
50
if ( configuration . request === 'attach' ) {
51
51
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
+ ) ;
52
57
return new DebugAdapterServer ( configuration . connect . port , configuration . connect . host ?? '127.0.0.1' ) ;
53
58
} else if ( configuration . port !== undefined ) {
59
+ traceLog ( `Connecting to DAP Server at: ${ configuration . host ?? '127.0.0.1' } :${ configuration . port } ` ) ;
54
60
return new DebugAdapterServer ( configuration . port , configuration . host ?? '127.0.0.1' ) ;
55
61
} else if ( configuration . listen === undefined && configuration . processId === undefined ) {
56
62
throw new Error ( '"request":"attach" requires either "connect", "listen", or "processId"' ) ;
@@ -70,10 +76,9 @@ export class DebugAdapterDescriptorFactory implements IDebugAdapterDescriptorFac
70
76
const logArgs = configuration . logToFile ? [ '--log-dir' , EXTENSION_ROOT_DIR ] : [ ] ;
71
77
72
78
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 ) ;
77
82
}
78
83
79
84
const debuggerAdapterPathToUse = path . join (
@@ -85,8 +90,10 @@ export class DebugAdapterDescriptorFactory implements IDebugAdapterDescriptorFac
85
90
'adapter' ,
86
91
) ;
87
92
93
+ const args = command . concat ( [ debuggerAdapterPathToUse , ...logArgs ] ) ;
94
+ traceLog ( `DAP Server launched with command: ${ executable } ${ args . join ( ' ' ) } ` ) ;
88
95
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 ) ;
90
97
}
91
98
92
99
// Unlikely scenario.
@@ -136,10 +143,16 @@ export class DebugAdapterDescriptorFactory implements IDebugAdapterDescriptorFac
136
143
return this . getExecutableCommand ( interpreters [ 0 ] ) ;
137
144
}
138
145
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
+
139
152
private async getExecutableCommand ( interpreter : PythonEnvironment | undefined ) : Promise < string [ ] > {
140
153
if ( interpreter ) {
141
154
if ( interpreter . envType === EnvironmentType . Conda ) {
142
- const condaCommand = await Conda . getConda ( ) ;
155
+ const condaCommand = await this . getCondaCommand ( ) ;
143
156
if ( condaCommand ) {
144
157
if ( interpreter . envName ) {
145
158
return [
0 commit comments