Skip to content

Commit 7b1f541

Browse files
authored
Resolve issue #5102: Support input variables for envFile (#5189)
This fixes #5102
1 parent 1d477d2 commit 7b1f541

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/configurationProvider.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export class CSharpConfigurationProvider implements vscode.DebugConfigurationPro
146146
/**
147147
* Try to add all missing attributes to the debug configuration being launched.
148148
*/
149-
resolveDebugConfiguration(folder: vscode.WorkspaceFolder | undefined, config: vscode.DebugConfiguration, token?: vscode.CancellationToken): vscode.ProviderResult<vscode.DebugConfiguration> {
149+
resolveDebugConfigurationWithSubstitutedVariables(folder: vscode.WorkspaceFolder | undefined, config: vscode.DebugConfiguration, token?: vscode.CancellationToken): vscode.ProviderResult<vscode.DebugConfiguration> {
150150

151151
if (!config.type) {
152152
// If the config doesn't look functional force VSCode to open a configuration file https://github.com/Microsoft/vscode/issues/54213
@@ -155,15 +155,15 @@ export class CSharpConfigurationProvider implements vscode.DebugConfigurationPro
155155

156156
if (config.request === "launch") {
157157
if (!config.cwd && !config.pipeTransport) {
158-
config.cwd = "${workspaceFolder}";
158+
config.cwd = folder?.uri?.fsPath; // Workspace folder
159159
}
160160
if (!config.internalConsoleOptions) {
161161
config.internalConsoleOptions = "openOnSessionStart";
162162
}
163163

164164
// read from envFile and set config.env
165165
if (config.envFile) {
166-
config = this.parseEnvFile(config.envFile.replace(/\${workspaceFolder}/g, folder.uri.fsPath), config);
166+
config = this.parseEnvFile(config.envFile, config);
167167
}
168168
}
169169

0 commit comments

Comments
 (0)