Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 (#7206)

* Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463

* fix config changes

* fix strictnull checks
This commit is contained in:
Anthony Dresser
2019-09-15 22:38:26 -07:00
committed by GitHub
parent fa6c52699e
commit ea0f9e6ce9
1226 changed files with 21541 additions and 17633 deletions

View File

@@ -20,7 +20,6 @@ import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/co
import { values } from 'vs/base/common/map';
import { IFileIconTheme, IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { toggleClass, addClass } from 'vs/base/browser/dom';
import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
function filterViewRegisterEvent(container: ViewContainer, event: Event<{ viewContainer: ViewContainer, views: IViewDescriptor[] }>): Event<IViewDescriptor[]> {
@@ -382,7 +381,7 @@ export class ContributableViewsModel extends Disposable {
return 0;
}
return (this.getViewOrder(a) - this.getViewOrder(b)) || this.getGroupOrderResult(a, b) || (a.id < b.id ? -1 : 1);
return (this.getViewOrder(a) - this.getViewOrder(b)) || this.getGroupOrderResult(a, b);
}
private getGroupOrderResult(a: IViewDescriptor, b: IViewDescriptor) {
@@ -434,7 +433,7 @@ export class ContributableViewsModel extends Disposable {
const splices = sortedDiff<IViewDescriptor>(
this.viewDescriptors,
viewDescriptors,
this.compareViewDescriptors.bind(this)
(a, b) => a.id === b.id ? 0 : a.id < b.id ? -1 : 1
).reverse();
const toRemove: { index: number, viewDescriptor: IViewDescriptor }[] = [];
@@ -522,9 +521,7 @@ export class PersistentContributableViewsModel extends ContributableViewsModel {
}
private saveWorkspaceViewsStates(): void {
const storedViewsStates: { [id: string]: IStoredWorkspaceViewState } = {};
let hasState = false;
const storedViewsStates: { [id: string]: IStoredWorkspaceViewState } = JSON.parse(this.storageService.get(this.workspaceViewsStateStorageId, StorageScope.WORKSPACE, '{}'));
for (const viewDescriptor of this.viewDescriptors) {
const viewState = this.viewStates.get(viewDescriptor.id);
if (viewState) {
@@ -534,11 +531,10 @@ export class PersistentContributableViewsModel extends ContributableViewsModel {
size: viewState.size,
order: viewDescriptor.workspace && viewState ? viewState.order : undefined
};
hasState = true;
}
}
if (hasState) {
if (Object.keys(storedViewsStates).length > 0) {
this.storageService.store(this.workspaceViewsStateStorageId, JSON.stringify(storedViewsStates), StorageScope.WORKSPACE);
} else {
this.storageService.remove(this.workspaceViewsStateStorageId, StorageScope.WORKSPACE);
@@ -638,7 +634,7 @@ export class PersistentContributableViewsModel extends ContributableViewsModel {
export class ViewsService extends Disposable implements IViewsService {
_serviceBrand!: ServiceIdentifier<any>;
_serviceBrand: undefined;
private readonly viewDescriptorCollections: Map<ViewContainer, { viewDescriptorCollection: IViewDescriptorCollection, disposable: IDisposable }>;
private readonly viewDisposable: Map<IViewDescriptor, IDisposable>;