Closed bereal closed 3 years ago
After debugging a bit, I found a solution by patching settings.ts
as follows:
diff --git a/src/debugadapter.ts b/src/debugadapter.ts
index 1a71edf..a8e26ad 100755
--- a/src/debugadapter.ts
+++ b/src/debugadapter.ts
@@ -429,7 +429,10 @@ export class DebugSessionClass extends DebugSession {
Utility.setRootPath((vscode.workspace.workspaceFolders) ? vscode.workspace.workspaceFolders[0].uri.fsPath : '');
// Save args
- const rootFolder=(vscode.workspace.workspaceFolders)? vscode.workspace.workspaceFolders[0].uri.fsPath:'';
+ const rootFolder = args.rootFolder || (
+ (vscode.workspace.workspaceFolders) ? vscode.workspace.workspaceFolders[0].uri.fsPath : '');
+ Utility.setRootPath(rootFolder);
+
Settings.Init(args, rootFolder);
Settings.CheckSettings();
}
I'm not sure if this aligns with the project design, in particular, whether this is a proper place to set Utility.rootPath
, but at least solved my problem. Let know if this helps, I can make a PR then.
Thanks for finding (and solving). Yes, this should be the solution. This root folder code in DeZog is rather old, even older than the workspace concept. But it doesn't make any sense to ignore the args.rootFolder.
No need to do a PR. I will include the change as:
const rootFolder = args.rootFolder || vscode.workspace.workspaceFolders![0].uri.fsPath;
Utility.setRootPath(rootFolder);
I.e. when there is a launch.json there always should also be a workspaceFolder, so I'm not checking this anymore.
Furthermore I think I have to change a few other location where I used it for the Z80 unit tests.
Describe the bug DeZog can't seem to resolve workspace folder paths
To Reproduce
I have multiple projects in my VSCode workspace, one of them is a Z80 projects.
Here is my entire
zx/.vscode/launch.json
:When I try running the project, the error message is like
So it tries to find it in a wrong workspace folder. If I add prefix
${workspaceFolder}/
to all the paths, it launches, but immediately fails to find the source path, still looking for it in another project.Version etc. (please complete the following information):
VSCode: 1.53.2 OS: Linux x64 5.10.7-3-MANJARO DeZog SW Version: v2.1.7 Remote: zsim