Skip to content
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

Graciously handling DAP failure on multistep (build then run) languages #415

Open
fnzr opened this issue Jun 2, 2024 Discussed in #414 · 1 comment
Open

Graciously handling DAP failure on multistep (build then run) languages #415

fnzr opened this issue Jun 2, 2024 Discussed in #414 · 1 comment

Comments

@fnzr
Copy link

fnzr commented Jun 2, 2024

Hello!
I'm working on improving the DAP handling on the zig adapter, and we are exploring how to handle build errors.

When running tests with integrated strategy, we have a nice feedback on compile errors:

2024-06-02-12:10:36-screenshot

We are now trying to figure out how to do something similar when using the dap strategy.

Languages that require building before running tests can fail in either step, and when using the dap strategy, I don't see any way to gracefully handle it: the the debugger is always launched in a invalid state.

This is not a zig specific issue, it happens with the golang adapter:

2024-06-02-12:03:52-screenshot

The rust adapter does its best to identify and report build errors, but can't do anything about it, and the debugger is also launched in an invalid state:

2024-06-02-12:04:34-screenshot

As I understand it, there's nothing the adapter can do about this problem. The dap strategy expects a dap configuration, and not providing it results in either a "adapter doesn't support the dap strategy" message, some cryptic configuration error, or launching the debugger in a bad state, because the strategy handler either expects nothing, or just launches.

(here)

return function(spec, context)

It would be nice if the adapters could somehow report to the strategy handler that "hey, something bad happened, do not launch the debugger"

Does this feature exists (maybe I'm just missing it)? If not, would it be doable?

@rcarriga
Copy link
Collaborator

rcarriga commented Jun 9, 2024

The feature doesn't currently exist but happy to take PRs for the dap strategy to be able to show these kind of errors and not run the debugger 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants