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

startDebugging method in vscode still return true even when the build fails #54214

Closed
rodrigovaras opened this issue Jul 12, 2018 · 5 comments · Fixed by #59617
Closed

startDebugging method in vscode still return true even when the build fails #54214

rodrigovaras opened this issue Jul 12, 2018 · 5 comments · Fixed by #59617
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Milestone

Comments

@rodrigovaras
Copy link
Contributor

Live share extension on the host side is using the startDebugging method to launch a debug configuration remotely. As part of step it will eventually need to invoke a task to build that could fail, the problem is that the API will not report 'false' value during the invocation.
Extract of the code here:

const result = await vscode.debug.startDebugging(folders ? folders[0] : undefined, debugConfiguration);
if (!result) {
// THIS code almost never get invoked....
throw new Error(Failed to launch debug configuration:${debugConfiguration.name});
}

we would like a better mechanism to know what really happen in our launch invocation.
Maybe knowing:

  • If the build task was cancelled
  • task failed
  • Debug configuration is invalid
  • Failure to launch

Adding a new richer method may be better...

@weinand weinand added debug Debug viewlet, configurations, breakpoints, adapter issues bug Issue identified by VS Code Team member as probable bug labels Jul 27, 2018
@weinand weinand added this to the On Deck milestone Jul 27, 2018
@Eskibear
Copy link
Member

I have exact the same problem with the API vscode.debug.startDebugging.

When was starting a Java debug session with the API vscode.debug.startDebugging, build error occurs. It popped up a message dialog letting me choose whether to "Proceed" or "Abort". This part is provided in extension "Debugger for Java". See: https://github.com/Microsoft/vscode-java-debug/blob/0e86ed2cc7e67f423a25421627dad33a89f4a2a2/src/configurationProvider.ts#L116-L119

After clicking "Abort", resolveDebugConfiguration returns "undefined".
According to the VS Code API , the debug session will not start.

Returning the value 'undefined' prevents the debug session from starting.

But actually vscode.debug.startDebugging still resolves "true", it does not match the API spec:

@return A thenable that resolves when debugging could be successfully started.

@weinand
Copy link
Contributor

weinand commented Sep 13, 2018

duplicate of #53874

@weinand weinand closed this as completed Sep 13, 2018
@weinand weinand added the *duplicate Issue identified as a duplicate of another issue(s) label Sep 13, 2018
@weinand weinand reopened this Sep 17, 2018
@weinand weinand modified the milestones: On Deck, September 2018 Sep 17, 2018
@weinand weinand removed *duplicate Issue identified as a duplicate of another issue(s) api labels Sep 17, 2018
@weinand
Copy link
Contributor

weinand commented Sep 17, 2018

After #53874 has been fixed it now becomes clear that there is another issue that prevents build errors from bubbling up to the extension API.

I've investigated this and created additional debt items #58822 and #58817. It would be great if we could resolve this item for September even if we are not able to fully resolve the debt items.

@roblourens
Copy link
Member

Is it enough to verify that a build error reaches the startDebugging API? Or was there a more specific issue with it?

@roblourens roblourens added the verification-steps-needed Steps to verify are needed for verification label Nov 2, 2018
@isidorn
Copy link
Contributor

isidorn commented Nov 5, 2018

The startDebugging API was always returning true. To verify:

  1. Have a wrong launch configuration, verify that startDebuggin returns false
  2. Have a prelaunch task that fails and verify that startDebugging returns false if you decided not to continue debugging

@isidorn isidorn removed the verification-steps-needed Steps to verify are needed for verification label Nov 5, 2018
@ramya-rao-a ramya-rao-a added the verified Verification succeeded label Nov 9, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants