Add option to create launch config in workspace file#97321
Add option to create launch config in workspace file#97321isidorn merged 3 commits intomicrosoft:masterfrom
Conversation
| async openConfigFile(sideBySide: boolean, preserveFocus: boolean, type?: string, token?: CancellationToken): Promise<{ editor: IEditorPane | null, created: boolean }> { | ||
| const ws = this.contextService.getWorkspace(); | ||
|
|
||
| if (ws.folders.length === 0) { |
There was a problem hiding this comment.
Is this check necesery?
If I do not have any folders in the workspace I do not even get offered "workspace" in the quick pick
There was a problem hiding this comment.
That's an edge case I found with the following steps:
- Open a folder
f1 - Add to workspace folder
f2. An untitled workspace will be created - Remove folder
f1andf2from the workspace. At this point we have no folders in the workspace. this.contextService.getWorkbenchStatereturnsWorkbenchState.WORKSPACE(is this expected?) so theopenConfigFilefunction gets called.
Thinking more about this I'll move that check here
There was a problem hiding this comment.
Yeah that state is the empty workspace state - you are stil in a workspace just do not have any folder in the workspace. So you are correct we should cover that case. Thanks
| if (!launchExistInFile) { | ||
| // Launch property in workspace config not found: create one by collecting launch configs from debugConfigProviders | ||
| let content = ''; | ||
| const adapter = await this.configurationManager.guessDebugger(type); |
There was a problem hiding this comment.
I see we have similar code in the Launch. Might it make sense to extract this code to the AbstractLaunch so both clases use it? Not sure if 100% good idea..
|
Thanks a lot for this PR, great work!
|
|
Pushed some changes addressing the feedback |
|
Thanks a lot for this PR. Merging in. |

This PR fixes #96567