From ad6fd533988d1cc6a042a04397bd6642cbffab39 Mon Sep 17 00:00:00 2001 From: Syed Ahmad <64008512+HackintoshwithUbuntu@users.noreply.github.com> Date: Thu, 15 Apr 2021 16:27:47 +1000 Subject: [PATCH 1/3] update ${workspaceFolder} to ${fileDirname} #7362 --- Extension/src/Debugger/configurationProvider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/src/Debugger/configurationProvider.ts b/Extension/src/Debugger/configurationProvider.ts index 08a34c8ef5..0e13093e21 100644 --- a/Extension/src/Debugger/configurationProvider.ts +++ b/Extension/src/Debugger/configurationProvider.ts @@ -194,7 +194,7 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider { // This property will be removed before writing the DebugConfiguration in launch.json. newConfig.detail = task.detail ? task.detail : definition.command; const isCl: boolean = compilerName === "cl.exe"; - newConfig.cwd = isWindows && !isCl && !process.env.PATH?.includes(path.dirname(compilerPath)) ? path.dirname(compilerPath) : "${workspaceFolder}"; + newConfig.cwd = isWindows && !isCl && !process.env.PATH?.includes(path.dirname(compilerPath)) ? path.dirname(compilerPath) : "${fileDirname}"; return new Promise(resolve => { if (platform === "darwin") { From 91393ad80ebee54912c59accf63dfea2240c10be Mon Sep 17 00:00:00 2001 From: Syed Ahmad <64008512+HackintoshwithUbuntu@users.noreply.github.com> Date: Thu, 15 Apr 2021 16:29:10 +1000 Subject: [PATCH 2/3] update ${workspaceFolder} to ${fileDirname} #7362 --- Extension/src/Debugger/configurations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/src/Debugger/configurations.ts b/Extension/src/Debugger/configurations.ts index 5f809cb446..38fde7e595 100644 --- a/Extension/src/Debugger/configurations.ts +++ b/Extension/src/Debugger/configurations.ts @@ -42,7 +42,7 @@ function createLaunchString(name: string, type: string, executable: string): str "program": "${localize("enter.program.name", "enter program name, for example {0}", "$\{workspaceFolder\}" + "/" + executable).replace(/\"/g, "\\\"")}", "args": [], "stopAtEntry": false, -"cwd": "$\{workspaceFolder\}", +"cwd": "$\{fileDirname\}", "environment": [], ${ type === "cppdbg" ? `"externalConsole": false` : `"console": "externalTerminal"` } `; From 1502b87e4728f80b5c7881d5381d7914dde71e32 Mon Sep 17 00:00:00 2001 From: Syed Ahmad <64008512+HackintoshwithUbuntu@users.noreply.github.com> Date: Fri, 16 Apr 2021 10:12:48 +1000 Subject: [PATCH 3/3] update ${workspaceFolder} to ${fileDirname} #7362 --- Extension/src/LanguageServer/cppBuildTaskProvider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/cppBuildTaskProvider.ts b/Extension/src/LanguageServer/cppBuildTaskProvider.ts index 10940e9b87..64532a4364 100644 --- a/Extension/src/LanguageServer/cppBuildTaskProvider.ts +++ b/Extension/src/LanguageServer/cppBuildTaskProvider.ts @@ -169,7 +169,7 @@ export class CppBuildTaskProvider implements TaskProvider { if (compilerArgs && compilerArgs.length > 0) { args = args.concat(compilerArgs); } - const cwd: string = isWindows && !isCl && !process.env.PATH?.includes(path.dirname(compilerPath)) ? path.dirname(compilerPath) : "${workspaceFolder}"; + const cwd: string = isWindows && !isCl && !process.env.PATH?.includes(path.dirname(compilerPath)) ? path.dirname(compilerPath) : "${fileDirname}"; const options: cp.ExecOptions | undefined = { cwd: cwd }; definition = { type: CppBuildTaskProvider.CppBuildScriptType,