mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-20 20:10:11 -04:00
Vscode merge (#4582)
* Merge from vscode 37cb23d3dd4f9433d56d4ba5ea3203580719a0bd * fix issues with merges * bump node version in azpipe * replace license headers * remove duplicate launch task * fix build errors * fix build errors * fix tslint issues * working through package and linux build issues * more work * wip * fix packaged builds * working through linux build errors * wip * wip * wip * fix mac and linux file limits * iterate linux pipeline * disable editor typing * revert series to parallel * remove optimize vscode from linux * fix linting issues * revert testing change * add work round for new node * readd packaging for extensions * fix issue with angular not resolving decorator dependencies
This commit is contained in:
@@ -19,7 +19,7 @@ import { Part, IPartOptions } from 'vs/workbench/browser/part';
|
||||
import { Composite, CompositeRegistry } from 'vs/workbench/browser/composite';
|
||||
import { IComposite } from 'vs/workbench/common/composite';
|
||||
import { ScopedProgressService } from 'vs/workbench/services/progress/browser/progressService';
|
||||
import { IPartService } from 'vs/workbench/services/part/common/partService';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
|
||||
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
@@ -32,6 +32,7 @@ import { attachProgressBarStyler } from 'vs/platform/theme/common/styler';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { Dimension, append, $, addClass, hide, show, addClasses } from 'vs/base/browser/dom';
|
||||
import { AnchorAlignment } from 'vs/base/browser/ui/contextview/contextview';
|
||||
import { withNullAsUndefined } from 'vs/base/common/types';
|
||||
|
||||
export interface ICompositeTitleLabel {
|
||||
|
||||
@@ -54,8 +55,8 @@ interface CompositeItem {
|
||||
|
||||
export abstract class CompositePart<T extends Composite> extends Part {
|
||||
|
||||
protected _onDidCompositeOpen = this._register(new Emitter<{ composite: IComposite, focus: boolean }>());
|
||||
protected _onDidCompositeClose = this._register(new Emitter<IComposite>());
|
||||
protected readonly onDidCompositeOpen = this._register(new Emitter<{ composite: IComposite, focus: boolean }>());
|
||||
protected readonly onDidCompositeClose = this._register(new Emitter<IComposite>());
|
||||
|
||||
protected toolBar: ToolBar;
|
||||
|
||||
@@ -75,7 +76,7 @@ export abstract class CompositePart<T extends Composite> extends Part {
|
||||
protected storageService: IStorageService,
|
||||
private telemetryService: ITelemetryService,
|
||||
protected contextMenuService: IContextMenuService,
|
||||
protected partService: IPartService,
|
||||
protected layoutService: IWorkbenchLayoutService,
|
||||
protected keybindingService: IKeybindingService,
|
||||
protected instantiationService: IInstantiationService,
|
||||
themeService: IThemeService,
|
||||
@@ -84,11 +85,11 @@ export abstract class CompositePart<T extends Composite> extends Part {
|
||||
private defaultCompositeId: string,
|
||||
private nameForTelemetry: string,
|
||||
private compositeCSSClass: string,
|
||||
private titleForegroundColor: string,
|
||||
private titleForegroundColor: string | undefined,
|
||||
id: string,
|
||||
options: IPartOptions
|
||||
) {
|
||||
super(id, options, themeService, storageService);
|
||||
super(id, options, themeService, storageService, layoutService);
|
||||
|
||||
this.mapCompositeToCompositeContainer = {};
|
||||
this.mapActionsBindingToComposite = {};
|
||||
@@ -98,6 +99,7 @@ export abstract class CompositePart<T extends Composite> extends Part {
|
||||
}
|
||||
|
||||
protected openComposite(id: string, focus?: boolean): Composite | undefined {
|
||||
|
||||
// Check if composite already visible and just focus in that case
|
||||
if (this.activeComposite && this.activeComposite.getId() === id) {
|
||||
if (focus) {
|
||||
@@ -140,7 +142,7 @@ export abstract class CompositePart<T extends Composite> extends Part {
|
||||
composite.focus();
|
||||
}
|
||||
|
||||
this._onDidCompositeOpen.fire({ composite, focus });
|
||||
this.onDidCompositeOpen.fire({ composite, focus });
|
||||
return composite;
|
||||
}
|
||||
|
||||
@@ -152,7 +154,7 @@ export abstract class CompositePart<T extends Composite> extends Part {
|
||||
|
||||
// Return with the composite that is being opened
|
||||
if (composite) {
|
||||
this._onDidCompositeOpen.fire({ composite, focus });
|
||||
this.onDidCompositeOpen.fire({ composite, focus });
|
||||
}
|
||||
|
||||
return composite;
|
||||
@@ -222,7 +224,7 @@ export abstract class CompositePart<T extends Composite> extends Part {
|
||||
// Report progress for slow loading composites (but only if we did not create the composites before already)
|
||||
const compositeItem = this.instantiatedCompositeItems.get(composite.getId());
|
||||
if (compositeItem && !compositeContainer) {
|
||||
compositeItem.progressService.showWhile(Promise.resolve(), this.partService.isRestored() ? 800 : 3200 /* less ugly initial startup */);
|
||||
compositeItem.progressService.showWhile(Promise.resolve(), this.layoutService.isRestored() ? 800 : 3200 /* less ugly initial startup */);
|
||||
}
|
||||
|
||||
// Fill Content and Actions
|
||||
@@ -244,7 +246,7 @@ export abstract class CompositePart<T extends Composite> extends Part {
|
||||
// Update title with composite title if it differs from descriptor
|
||||
const descriptor = this.registry.getComposite(composite.getId());
|
||||
if (descriptor && descriptor.name !== composite.getTitle()) {
|
||||
this.updateTitle(composite.getId(), composite.getTitle() || undefined);
|
||||
this.updateTitle(composite.getId(), withNullAsUndefined(composite.getTitle()));
|
||||
}
|
||||
|
||||
// Handle Composite Actions
|
||||
@@ -341,6 +343,9 @@ export abstract class CompositePart<T extends Composite> extends Part {
|
||||
primaryActions.push(...this.getActions());
|
||||
secondaryActions.push(...this.getSecondaryActions());
|
||||
|
||||
// Update context
|
||||
this.toolBar.context = this.actionsContextProvider();
|
||||
|
||||
// Return fn to set into toolbar
|
||||
return this.toolBar.setActions(prepareActions(primaryActions), prepareActions(secondaryActions));
|
||||
}
|
||||
@@ -375,7 +380,7 @@ export abstract class CompositePart<T extends Composite> extends Part {
|
||||
|
||||
// Empty Actions
|
||||
this.toolBar.setActions([])();
|
||||
this._onDidCompositeClose.fire(composite);
|
||||
this.onDidCompositeClose.fire(composite);
|
||||
|
||||
return composite;
|
||||
}
|
||||
@@ -415,12 +420,12 @@ export abstract class CompositePart<T extends Composite> extends Part {
|
||||
},
|
||||
|
||||
updateStyles: () => {
|
||||
titleLabel.style.color = $this.getColor($this.titleForegroundColor);
|
||||
titleLabel.style.color = $this.titleForegroundColor ? $this.getColor($this.titleForegroundColor) : null;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
protected updateStyles(): void {
|
||||
updateStyles(): void {
|
||||
super.updateStyles();
|
||||
|
||||
// Forward to title label
|
||||
@@ -437,6 +442,16 @@ export abstract class CompositePart<T extends Composite> extends Part {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected actionsContextProvider(): any {
|
||||
|
||||
// Check Active Composite
|
||||
if (this.activeComposite) {
|
||||
return this.activeComposite.getActionsContext();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
createContentArea(parent: HTMLElement): HTMLElement {
|
||||
const contentContainer = append(parent, $('.content'));
|
||||
|
||||
@@ -449,6 +464,7 @@ export abstract class CompositePart<T extends Composite> extends Part {
|
||||
|
||||
getProgressIndicator(id: string): IProgressService | null {
|
||||
const compositeItem = this.instantiatedCompositeItems.get(id);
|
||||
|
||||
return compositeItem ? compositeItem.progressService : null;
|
||||
}
|
||||
|
||||
@@ -464,27 +480,20 @@ export abstract class CompositePart<T extends Composite> extends Part {
|
||||
return AnchorAlignment.RIGHT;
|
||||
}
|
||||
|
||||
layout(dimension: Dimension): Dimension[];
|
||||
layout(width: number, height: number): void;
|
||||
layout(dim1: Dimension | number, dim2?: number): Dimension[] | void {
|
||||
// Pass to super
|
||||
const sizes = super.layout(dim1 instanceof Dimension ? dim1 : new Dimension(dim1, dim2!));
|
||||
layout(width: number, height: number): void {
|
||||
|
||||
// Pass Contentsize to composite
|
||||
this.contentAreaSize = sizes[1];
|
||||
// Layout contents
|
||||
this.contentAreaSize = super.layoutContents(width, height).contentSize;
|
||||
|
||||
// Layout composite
|
||||
if (this.activeComposite) {
|
||||
this.activeComposite.layout(this.contentAreaSize);
|
||||
}
|
||||
|
||||
if (dim1 instanceof Dimension) {
|
||||
return sizes;
|
||||
}
|
||||
}
|
||||
|
||||
protected removeComposite(compositeId: string): boolean {
|
||||
if (this.activeComposite && this.activeComposite.getId() === compositeId) {
|
||||
// do not remove active compoiste
|
||||
return false;
|
||||
return false; // do not remove active composite
|
||||
}
|
||||
|
||||
delete this.mapCompositeToCompositeContainer[compositeId];
|
||||
@@ -495,6 +504,7 @@ export abstract class CompositePart<T extends Composite> extends Part {
|
||||
dispose(compositeItem.disposable);
|
||||
this.instantiatedCompositeItems.delete(compositeId);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user