Skip to content

Commit 2cc04c8

Browse files
committed
Use wsDir and not wsFile. Bug fixed
1 parent 8137835 commit 2cc04c8

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/frontend/configprovider.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,16 @@ export class CortexDebugConfigurationProvider implements vscode.DebugConfigurati
204204
config: vscode.DebugConfiguration,
205205
token?: vscode.CancellationToken
206206
): vscode.ProviderResult<vscode.DebugConfiguration> {
207-
let cwd = config.cwd || folder?.uri.fsPath || vscode.workspace.workspaceFile?.fsPath || '.';
207+
const wsFile = vscode.workspace.workspaceFile?.fsPath;
208+
let cwd = config.cwd || folder?.uri.fsPath || (wsFile ? path.dirname(wsFile) : '.');
208209
const isAbsCwd = path.isAbsolute(cwd);
209210
if (!isAbsCwd && folder) {
210211
cwd = path.join(folder.uri.fsPath, cwd);
211212
} else if (!isAbsCwd) {
212213
cwd = path.resolve(cwd);
213214
}
214215
config.cwd = cwd;
215-
if (!fs.existsSync(cwd)) {
216+
if (!cwd || !fs.existsSync(cwd)) {
216217
vscode.window.showWarningMessage(`Invalid "cwd": "${cwd}". Many operations can fail. Trying to continue`);
217218
}
218219
this.validateLoadAndSymbolFiles(config, cwd);

0 commit comments

Comments
 (0)