mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-01 17:23:35 -05:00
Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 (#7206)
* Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 * fix config changes * fix strictnull checks
This commit is contained in:
@@ -419,7 +419,7 @@ export class LoadedScriptsView extends ViewletPanel {
|
||||
this.treeLabels = this.instantiationService.createInstance(ResourceLabels, { onDidChangeVisibility: this.onDidChangeBodyVisibility });
|
||||
this._register(this.treeLabels);
|
||||
|
||||
this.tree = this.instantiationService.createInstance(WorkbenchAsyncDataTree, this.treeContainer, new LoadedScriptsDelegate(),
|
||||
this.tree = this.instantiationService.createInstance(WorkbenchAsyncDataTree, 'LoadedScriptsView', this.treeContainer, new LoadedScriptsDelegate(),
|
||||
[new LoadedScriptsRenderer(this.treeLabels)],
|
||||
new LoadedScriptsDataSource(),
|
||||
{
|
||||
@@ -466,7 +466,21 @@ export class LoadedScriptsView extends ViewletPanel {
|
||||
}
|
||||
}));
|
||||
|
||||
const registerLoadedSourceListener = (session: IDebugSession) => {
|
||||
const scheduleRefreshOnVisible = () => {
|
||||
if (this.isBodyVisible()) {
|
||||
this.changeScheduler.schedule();
|
||||
} else {
|
||||
this.treeNeedsRefreshOnVisible = true;
|
||||
}
|
||||
};
|
||||
|
||||
const registerSessionListeners = (session: IDebugSession) => {
|
||||
this._register(session.onDidChangeName(() => {
|
||||
// Re-add session, this will trigger proper sorting and id recalculation.
|
||||
root.remove(session.getId());
|
||||
root.add(session);
|
||||
scheduleRefreshOnVisible();
|
||||
}));
|
||||
this._register(session.onDidLoadedSource(event => {
|
||||
let sessionRoot: SessionTreeItem;
|
||||
switch (event.reason) {
|
||||
@@ -474,11 +488,7 @@ export class LoadedScriptsView extends ViewletPanel {
|
||||
case 'changed':
|
||||
sessionRoot = root.add(session);
|
||||
sessionRoot.addPath(event.source);
|
||||
if (this.isBodyVisible()) {
|
||||
this.changeScheduler.schedule();
|
||||
} else {
|
||||
this.treeNeedsRefreshOnVisible = true;
|
||||
}
|
||||
scheduleRefreshOnVisible();
|
||||
if (event.reason === 'changed') {
|
||||
DebugContentProvider.refreshDebugContent(event.source.uri);
|
||||
}
|
||||
@@ -486,11 +496,7 @@ export class LoadedScriptsView extends ViewletPanel {
|
||||
case 'removed':
|
||||
sessionRoot = root.find(session);
|
||||
if (sessionRoot && sessionRoot.removePath(event.source)) {
|
||||
if (this.isBodyVisible()) {
|
||||
this.changeScheduler.schedule();
|
||||
} else {
|
||||
this.treeNeedsRefreshOnVisible = true;
|
||||
}
|
||||
scheduleRefreshOnVisible();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -501,8 +507,8 @@ export class LoadedScriptsView extends ViewletPanel {
|
||||
}));
|
||||
};
|
||||
|
||||
this._register(this.debugService.onDidNewSession(registerLoadedSourceListener));
|
||||
this.debugService.getModel().getSessions().forEach(registerLoadedSourceListener);
|
||||
this._register(this.debugService.onDidNewSession(registerSessionListeners));
|
||||
this.debugService.getModel().getSessions().forEach(registerSessionListeners);
|
||||
|
||||
this._register(this.debugService.onDidEndSession(session => {
|
||||
root.remove(session.getId());
|
||||
|
||||
Reference in New Issue
Block a user