Skip to content

Commit

Permalink
debug: improve multi-root experience for configs (eclipse-theia#12674)
Browse files Browse the repository at this point in the history
The commit improves the behavior and functionality for displaying and opening debug configurations in multi-root workspaces. 

The updates mean that the list of debug configurations is properly updated when a workspace root is added/removed. The changes also update the "open configuration" command to open the `launch.json` at the root of the currently selected debug configuration.
  • Loading branch information
Maddobun committed Jul 13, 2023
1 parent ecb8e1e commit 84fe3d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/debug/src/browser/debug-configuration-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export class DebugConfigurationManager {
protected async doInit(): Promise<void> {
this.debugConfigurationTypeKey = this.contextKeyService.createKey<string>('debugConfigurationType', undefined);
this.initialized = this.preferences.ready.then(() => {
this.workspaceService.onWorkspaceChanged(this.updateModels);
this.preferences.onPreferenceChanged(e => {
if (e.preferenceName === 'launch') {
this.updateModels();
Expand Down Expand Up @@ -312,7 +313,8 @@ export class DebugConfigurationManager {
}

async openConfiguration(): Promise<void> {
const model = this.getModel();
const currentUri = new URI(this.current?.workspaceFolderUri);
const model = this.getModel(currentUri);
if (model) {
await this.doOpen(model);
}
Expand Down

0 comments on commit 84fe3d9

Please sign in to comment.