-
Notifications
You must be signed in to change notification settings - Fork 12
Add DAP locator that will auto-convert zig build into debug session #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Extracted from #10 Implements custom tasks: * `zig build test` * `zig build run` * `zig test $ZED_FILE --test-filter $ZED_CUSTOM_ZIG_TEST_NAME` - which runs during runnable code detection
17ccb2b to
f57d6af
Compare
| .and_then(|cwd| Some(Path::new(&cwd).file_name()?.to_string_lossy().into_owned())) | ||
| } | ||
|
|
||
| fn get_test_exe_path() -> Option<String> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will trip over itself the moment somebody runs two tests (possibly in unrelated projects) concurrently. :/ Could we include some kind of disambiguator here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good catch. Originally I wanted to use project name but CWD is not set at this point. However, thinking about it some more, maybe use UUID that will persist for the duration of this debugging session or something? Kinda feels like reimplementing compiler's caching logic...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of notable changes that will land as part of this PR:
std::env::current_dir()handling on Windows hostExtensiontrait, and in particulardap_locator_create_scenarioandrun_dap_locatorzig build runandzig build testdirectly from the command palettezig build runandzig test --test-filterinto a debug scenario both of which can be triggered at the GUI level via run/debug markersThis final step comes with a caveat for
zig build run, namely, it assumes the project has been created withzig initand the project name matches the executable name. I think this is a fair assumption. In other cases, for more elaborate/custom projects I think it is reasonable to expect the user to create a custom debug config.TODO: