-
Notifications
You must be signed in to change notification settings - Fork 517
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
make the launch.json generation leaner #618
Conversation
Adding @philliphoff as he owns the .NET Core debugging part of the code. |
The scaffolded launch configuration for Docker .NET Core debugging is fairly lean; it adds only the optional
That's not a bad idea, though multi-stage Dockerfiles (such as scaffolded by .NET Core tooling) could complicate that (as you'd want the last That said, the |
request: 'attach', | ||
remoteRoot | ||
}]; | ||
}); |
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.
For any new code added, we tend to avoid thenable in favor of async-await.
Debugging this code has seemed easier when the code is written as :
let remoteRoot = await vscode.window.showInputBox({ value: '/usr/src/app', prompt: 'Please enter your Docker remote root'});
return [{
name: 'Docker: Attach to Node',
type: 'node',
request: 'attach',
remoteRoot
}];
You would need to make the function async however, so I'll defer to @StephenWeatherford whether requiring this standard is worth it 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.
Yes, please do convert. Also, please use ext.ui.showInputBox instead of vscode.window.showInputBox. Note that this will throw on user cancel, which I assume makes sense 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.
Thanks for the review and suggestions I have pushed a commit which takes care of this.
@philliphoff thanks for your reply. In the end I leave making this leaner and more simply to you since I do not know what are the biggest pain points that users face when setting up docker debugging. Let me know if there is something on the vscode side we can do to improve this. Just for reference what is the scaffolded launch configuration for Docker .NET? |
Is there something else that needs to be done on my end here? |
@isidorn For reference, this is the scaffolded Docker .NET Core launch configuration: {
"name": "Docker: Launch .NET Core (Preview)",
"type": "docker-coreclr",
"request": "launch",
"preLaunchTask": "build",
"dockerBuild": {},
"dockerRun": {}
} |
@philliphoff I'm assuming you're signing off on this PR... Thx. |
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.
Looks ok to me, though I'm less knowledgable about the Node debugging side of things versus the .NET Core debugging side.
Great thanks. Should I click the merge button or will you, not sure what is the procedure here. Thanks! |
@StephenWeatherford Are you ok with the changes? |
@isidorn, @philliphoff Thanks! |
fixes #612
This PR simplifies the generated
launch.json
in the following ways:What still needs to be done imho:
/usr/src/app
Please enter your Docker remote root
is correct here, maybe WORKDIR instead of remote root.@StephenWeatherford let me know what you think. Thanks a lot
fyi @chrisdias