Skip to content

Commit

Permalink
Use wsDir and not wsFile. Bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
haneefdm committed Jan 16, 2025
1 parent 8137835 commit 2cc04c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/frontend/configprovider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,16 @@ export class CortexDebugConfigurationProvider implements vscode.DebugConfigurati
config: vscode.DebugConfiguration,
token?: vscode.CancellationToken
): vscode.ProviderResult<vscode.DebugConfiguration> {
let cwd = config.cwd || folder?.uri.fsPath || vscode.workspace.workspaceFile?.fsPath || '.';
const wsFile = vscode.workspace.workspaceFile?.fsPath;
let cwd = config.cwd || folder?.uri.fsPath || (wsFile ? path.dirname(wsFile) : '.');
const isAbsCwd = path.isAbsolute(cwd);
if (!isAbsCwd && folder) {
cwd = path.join(folder.uri.fsPath, cwd);
} else if (!isAbsCwd) {
cwd = path.resolve(cwd);
}
config.cwd = cwd;
if (!fs.existsSync(cwd)) {
if (!cwd || !fs.existsSync(cwd)) {
vscode.window.showWarningMessage(`Invalid "cwd": "${cwd}". Many operations can fail. Trying to continue`);
}
this.validateLoadAndSymbolFiles(config, cwd);
Expand Down

0 comments on commit 2cc04c8

Please sign in to comment.