Problem
In the debugger's createDebugAdapterDescriptor, when config.workingDirectory is set to a relative path (e.g. "./subdir"), it is used as-is for spawn's cwd without resolving against folder.uri.fsPath. This means relative workingDirectory values resolve against the extension host process's cwd rather than the workspace folder.
On Windows, drive-relative forms like C:foo are especially problematic.
Current code
let cwd = folder.uri.fsPath;
if (config.workingDirectory) {
cwd = config.workingDirectory;
}
Suggested fix
Resolve relative workingDirectory against the workspace folder:
let cwd = folder.uri.fsPath;
if (config.workingDirectory) {
cwd = path.isAbsolute(config.workingDirectory)
? config.workingDirectory
: path.resolve(folder.uri.fsPath, config.workingDirectory);
}
Additional context
Surfaced during PR review of the fix for #33. This is pre-existing behavior, not a regression.
Problem
In the debugger's
createDebugAdapterDescriptor, whenconfig.workingDirectoryis set to a relative path (e.g."./subdir"), it is used as-is forspawn'scwdwithout resolving againstfolder.uri.fsPath. This means relativeworkingDirectoryvalues resolve against the extension host process's cwd rather than the workspace folder.On Windows, drive-relative forms like
C:fooare especially problematic.Current code
Suggested fix
Resolve relative
workingDirectoryagainst the workspace folder:Additional context
Surfaced during PR review of the fix for #33. This is pre-existing behavior, not a regression.