File tree Expand file tree Collapse file tree 4 files changed +11
-2
lines changed Expand file tree Collapse file tree 4 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -6,15 +6,18 @@ import * as fs from 'fs-extra';
6
6
import { parse } from 'jsonc-parser' ;
7
7
import { DebugConfiguration , Uri , WorkspaceFolder } from 'vscode' ;
8
8
import { getConfiguration , getWorkspaceFolder } from '../../../common/vscodeapi' ;
9
+ import { traceLog } from '../../../common/log/logging' ;
9
10
10
11
export async function getConfigurationsForWorkspace ( workspace : WorkspaceFolder ) : Promise < DebugConfiguration [ ] > {
12
+ traceLog ( 'Getting configurations for workspace' ) ;
11
13
const filename = path . join ( workspace . uri . fsPath , '.vscode' , 'launch.json' ) ;
12
14
if ( ! ( await fs . pathExists ( filename ) ) ) {
13
15
// Check launch config in the workspace file
14
16
const codeWorkspaceConfig = getConfiguration ( 'launch' , workspace ) ;
15
17
if ( ! codeWorkspaceConfig . configurations || ! Array . isArray ( codeWorkspaceConfig . configurations ) ) {
16
18
return [ ] ;
17
19
}
20
+ traceLog ( 'Using configuration in workspace' ) ;
18
21
return codeWorkspaceConfig . configurations ;
19
22
}
20
23
@@ -26,7 +29,7 @@ export async function getConfigurationsForWorkspace(workspace: WorkspaceFolder):
26
29
if ( ! parsed . version ) {
27
30
throw Error ( 'Missing field in launch.json: version' ) ;
28
31
}
29
- // We do not bother ensuring each item is a DebugConfiguration...
32
+ traceLog ( "Using configuration in launch.json" ) ;
30
33
return parsed . configurations ;
31
34
}
32
35
Original file line number Diff line number Diff line change @@ -8,13 +8,15 @@ import { getOSType, OSType } from '../../../common/platform';
8
8
import { AttachRequestArguments , DebugOptions , PathMapping } from '../../../types' ;
9
9
import { BaseConfigurationResolver } from './base' ;
10
10
import { getConfiguration } from '../../../common/vscodeapi' ;
11
+ import { traceLog } from '../../../common/log/logging' ;
11
12
12
13
export class AttachConfigurationResolver extends BaseConfigurationResolver < AttachRequestArguments > {
13
14
public async resolveDebugConfigurationWithSubstitutedVariables (
14
15
folder : WorkspaceFolder | undefined ,
15
16
debugConfiguration : AttachRequestArguments ,
16
17
_token ?: CancellationToken ,
17
18
) : Promise < AttachRequestArguments | undefined > {
19
+ traceLog ( 'Resolving attach configuration with substituted variables' ) ;
18
20
const workspaceFolder = AttachConfigurationResolver . getWorkspaceFolder ( folder ) ;
19
21
20
22
await this . provideAttachDefaults ( workspaceFolder , debugConfiguration as AttachRequestArguments ) ;
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import { resolveVariables } from '../utils/common';
16
16
import { getProgram } from './helper' ;
17
17
import { getSettingsPythonPath , getInterpreterDetails } from '../../../common/python' ;
18
18
import { getOSType , OSType } from '../../../common/platform' ;
19
+ import { traceLog } from '../../../common/log/logging' ;
19
20
20
21
export abstract class BaseConfigurationResolver < T extends DebugConfiguration >
21
22
implements IDebugConfigurationResolver < T >
@@ -62,14 +63,17 @@ export abstract class BaseConfigurationResolver<T extends DebugConfiguration>
62
63
const workspaceFolders = getWorkspaceFolders ( ) ;
63
64
64
65
if ( ! Array . isArray ( workspaceFolders ) || workspaceFolders . length === 0 ) {
66
+ traceLog ( "No workspace folder found" ) ;
65
67
return program ? Uri . file ( path . dirname ( program ) ) : undefined ;
66
68
}
67
69
if ( workspaceFolders . length === 1 ) {
70
+ traceLog ( "Using the only workspaceFolder found: " , workspaceFolders [ 0 ] . uri . fsPath ) ;
68
71
return workspaceFolders [ 0 ] . uri ;
69
72
}
70
73
if ( program ) {
71
74
const workspaceFolder = getVSCodeWorkspaceFolder ( Uri . file ( program ) ) ;
72
75
if ( workspaceFolder ) {
76
+ traceLog ( "Using workspaceFolder found for the program: " , workspaceFolder . uri . fsPath ) ;
73
77
return workspaceFolder . uri ;
74
78
}
75
79
}
Original file line number Diff line number Diff line change @@ -84,14 +84,14 @@ export async function registerDebugger(context: IExtensionContext): Promise<IExt
84
84
85
85
context . subscriptions . push (
86
86
registerCommand ( Commands . Debug_In_Terminal , async ( file ?: Uri ) => {
87
+ traceLog ( "Debugging using the editor button 'Debug in terminal'" ) ;
87
88
sendTelemetryEvent ( EventName . DEBUG_IN_TERMINAL_BUTTON ) ;
88
89
const interpreter = await getInterpreterDetails ( file ) ;
89
90
if ( ! interpreter . path ) {
90
91
runPythonExtensionCommand ( Commands . TriggerEnvironmentSelection , file ) . then ( noop , noop ) ;
91
92
return ;
92
93
}
93
94
const config = await getDebugConfiguration ( file ) ;
94
- traceLog ( "Debugging using the editor button 'Debug in terminal'" ) ;
95
95
startDebugging ( undefined , config ) ;
96
96
} ) ,
97
97
) ;
You can’t perform that action at this time.
0 commit comments