-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[debug] automatically create 'launch.json' #6490
Conversation
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.
May be on another PR, but If the end-user close the "Debug console" voluntary or not and he starts the debug session again, he does not see the end result. May be if the "Debug console" is closed when initiating the debug, we should open the "Debug console" view?
Otherwise, looks good to me
@@ -947,6 +947,11 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi | |||
|
|||
async start(noDebug?: boolean): Promise<void> { | |||
let { current } = this.configurations; | |||
// If not current configurations are present, create the `launch.json` and prompt users to select the config. |
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.
"If not current ..." or "If no current..."
@lmcbout I'm not sure I understand what you mean, could you clarify? |
If "Debug console" view is closed when you try to run the Debug session, the "Debug console" view will not show up and we don't see the result of the execution. May be if we don't see the execution result, we should open the "Debug console" view if closed to see the result. |
@lmcbout are you referring to when no
I don't see why the debug console would be opened for the second case, the same behavior is also present in VS Code. |
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 good to me. Thank you !
Why do we need to create an empty file? I don't think VS Code does it. Does it really fix #6489? |
It doesn't just create an empty file, it creates the file with the default launch schema, and also prompts users to add specific configs (for instance, creating a It is the same functionality present when executing the |
Can we reuse it? |
e492831
to
3998390
Compare
I refactored further so we can re-use the same logic present in the actual command. |
Automatically creates the `launch.json` file when executing the command `start debugging` whenever a `launch.json` does not exist under `.theia` or `.vscode`. Once created, users are prompted to select the type of debug configuration they desire. Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
3998390
to
3482288
Compare
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.
code wise looks good now, thank you
Thank you for your help in making it better 👍 |
What it does
Currently, when attempting to execute the command
Start Debugging
without alaunch.json
present under.theia
or.vscode
nothing occurs. The change ensures that if no configurations are found, thelaunch.json
is automatically created and users are then prompted to select their debug configuration type template.Additional steps will need to be done in the future to prompt the quick-open described in #6489.
How to test
.launch.json
Start Debugging
launch.json
if not present, and will prompt users in the editor to select the type of configlaunch.json
except the debugging should beginReview checklist
Reminder for reviewers
Signed-off-by: Vincent Fugnitto vincent.fugnitto@ericsson.com