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

Launch.json not automatically opened when resolveDebugConfigurations returns an error #43133

Closed
isidorn opened this issue Feb 7, 2018 · 8 comments
Assignees
Labels
candidate Issue identified as probable candidate for fixing in the next release debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded

Comments

@isidorn
Copy link
Contributor

isidorn commented Feb 7, 2018

This is a regression from the current stable.

Currently it is not possible for debug extensions to make vscode automatically open the launch.json in case they can not properly resolve a launch configuration.

Currently this is shown in the Dart extension, however @DanTup and me have worked on a workaround.
So I would wait more until choosing to have this in the recovery release.

@isidorn isidorn added debug Debug viewlet, configurations, breakpoints, adapter issues candidate Issue identified as probable candidate for fixing in the next release labels Feb 7, 2018
@isidorn isidorn self-assigned this Feb 7, 2018
@isidorn isidorn closed this as completed in 5c1c4b7 Feb 7, 2018
@DanTup
Copy link
Contributor

DanTup commented Feb 7, 2018

I've pushed an update to Dart Code with the workaround which at least fixes the issue of not being able to debug; however the user experience is a bit naff - when a user hits F5 on a project without a launch.json they are prompted twice to select the debug type/environment. Although I've noted that in the release notes; no doubt we'll get bug reports about it - so if it's not really risky, we'd obviously really like to see it in the recovery build.

@isidorn isidorn added this to the January 2018 Recovery milestone Feb 8, 2018
isidorn added a commit that referenced this issue Feb 12, 2018
@Tyriar Tyriar added the verified Verification succeeded label Feb 13, 2018
@Tyriar
Copy link
Member

Tyriar commented Feb 13, 2018

Verified via code review

@DanTup
Copy link
Contributor

DanTup commented Feb 14, 2018

@isidorn Just checked this in the recovery release and it doesn't seem to do what this issue suggests; it still shows the error to the user and does not open the launch.config.

err2

@DanTup
Copy link
Contributor

DanTup commented Feb 14, 2018

However, setting debugConfig.type = null; does cause it to open, so I no longer need to call commands.executeCommand("workbench.action.debug.configure");.

@isidorn
Copy link
Contributor Author

isidorn commented Feb 14, 2018

@DanTup exactly, the idea with the recovery release fix was for you to set debugConfig.type = null. Sorry if I did not communicate that clearly

@DanTup
Copy link
Contributor

DanTup commented Feb 14, 2018

Ah, ok!

The current workaround is working fine in 1.20.0 and 1.20.1, I was just tidying up code for my next release. I'm going to remove the executeCommand call and leave the type=null code. I will also flag is as requiring Code 1.20.1.

Going forwards, what is the preferred way for me to get launch.json opened? Should I throw an error? Throwing seems a little weird, but then so does setting type=null because the launch.json then appears with a type populated!

@isidorn
Copy link
Contributor Author

isidorn commented Feb 15, 2018

@DanTup for the moment let's leave the curent weird behavior that you leave type=null.
IMHO the proper way would be for you to throw an error in your resolving of the configuration.
Are you maybe interested in contributing to VSCode to handle this case properly.
Here's a pointer https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/debug/electron-browser/debugService.ts#L764
where you would have to open a launch.json

@DanTup
Copy link
Contributor

DanTup commented Feb 15, 2018

Sure.

My only concern with throwing an error is that it causes unexpected behaviour when there's a legitimate error. Eg. I wrote some bad code in my extension, and rather than seeing the error it just silently opens launch.json - and if it's not silent, then it will look like an error to my users when I actually wanted it. That's why it seems like there should be a more explicit way of communicating this.

Setting up Code so I can contribute to it has been on my todo list for a while; it's just not gotten to the top yet! So much to do :(

@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
candidate Issue identified as probable candidate for fixing in the next release debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants