mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
Make sure tha allViews are ready in remote explorer
Part of https://github.com/microsoft/vscode-remote-release/issues/1847
This commit is contained in:
@@ -350,22 +350,26 @@ export abstract class FilterViewContainerViewlet extends ViewContainerViewlet {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
this._register(this.viewsModel.onDidChangeActiveViews((viewDescriptors) => {
|
this._register(this.viewsModel.onDidChangeActiveViews((viewDescriptors) => {
|
||||||
viewDescriptors.forEach(descriptor => {
|
this.updateAllViews(viewDescriptors);
|
||||||
let filterOnValue = this.getFilterOn(descriptor);
|
|
||||||
if (!filterOnValue) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!this.allViews.has(filterOnValue)) {
|
|
||||||
this.allViews.set(filterOnValue, new Map());
|
|
||||||
}
|
|
||||||
this.allViews.get(filterOnValue)!.set(descriptor.id, descriptor);
|
|
||||||
if (filterOnValue !== this.filterValue) {
|
|
||||||
this.viewsModel.setVisible(descriptor.id, false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private updateAllViews(viewDescriptors: IViewDescriptor[]) {
|
||||||
|
viewDescriptors.forEach(descriptor => {
|
||||||
|
let filterOnValue = this.getFilterOn(descriptor);
|
||||||
|
if (!filterOnValue) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.allViews.has(filterOnValue)) {
|
||||||
|
this.allViews.set(filterOnValue, new Map());
|
||||||
|
}
|
||||||
|
this.allViews.get(filterOnValue)!.set(descriptor.id, descriptor);
|
||||||
|
if (filterOnValue !== this.filterValue) {
|
||||||
|
this.viewsModel.setVisible(descriptor.id, false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
protected addConstantViewDescriptors(constantViewDescriptors: IViewDescriptor[]) {
|
protected addConstantViewDescriptors(constantViewDescriptors: IViewDescriptor[]) {
|
||||||
constantViewDescriptors.forEach(viewDescriptor => this.constantViewDescriptors.set(viewDescriptor.id, viewDescriptor));
|
constantViewDescriptors.forEach(viewDescriptor => this.constantViewDescriptors.set(viewDescriptor.id, viewDescriptor));
|
||||||
}
|
}
|
||||||
@@ -415,6 +419,10 @@ export abstract class FilterViewContainerViewlet extends ViewContainerViewlet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onDidAddViews(added: IAddedViewDescriptorRef[]): ViewletPanel[] {
|
onDidAddViews(added: IAddedViewDescriptorRef[]): ViewletPanel[] {
|
||||||
|
// Check that allViews is ready
|
||||||
|
if (this.allViews.size === 0) {
|
||||||
|
this.updateAllViews(this.viewsModel.viewDescriptors);
|
||||||
|
}
|
||||||
const panels: ViewletPanel[] = super.onDidAddViews(added);
|
const panels: ViewletPanel[] = super.onDidAddViews(added);
|
||||||
for (let i = 0; i < added.length; i++) {
|
for (let i = 0; i < added.length; i++) {
|
||||||
if (this.constantViewDescriptors.has(added[i].viewDescriptor.id)) {
|
if (this.constantViewDescriptors.has(added[i].viewDescriptor.id)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user