Skip to content

Commit

Permalink
loaded scripts: register loaded srouce listener for all sessions
Browse files Browse the repository at this point in the history
fixes #57401
  • Loading branch information
isidorn committed Aug 29, 2018
1 parent 5dc2593 commit 012dada
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/vs/workbench/parts/debug/browser/loadedScriptsView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,7 @@ export class LoadedScriptsView extends TreeViewsViewletPanel {
this.tree.setInput(root);

let timeout: number;

this.disposables.push(this.debugService.onDidNewSession(session => {
const registerLoadedSourceListener = (session: ISession) => {
this.disposables.push(session.onDidLoadedSource(event => {
const sessionRoot = root.add(session);
sessionRoot.addPath(event.source);
Expand All @@ -383,7 +382,10 @@ export class LoadedScriptsView extends TreeViewsViewletPanel {
}
}, 300);
}));
}));
};

this.disposables.push(this.debugService.onDidNewSession(registerLoadedSourceListener));
this.debugService.getModel().getSessions().forEach(registerLoadedSourceListener);

this.disposables.push(this.debugService.onDidEndSession(session => {
clearTimeout(timeout);
Expand Down

0 comments on commit 012dada

Please sign in to comment.