Merge VS Code 1.21 source code (#1067)

* Initial VS Code 1.21 file copy with patches

* A few more merges

* Post npm install

* Fix batch of build breaks

* Fix more build breaks

* Fix more build errors

* Fix more build breaks

* Runtime fixes 1

* Get connection dialog working with some todos

* Fix a few packaging issues

* Copy several node_modules to package build to fix loader issues

* Fix breaks from master

* A few more fixes

* Make tests pass

* First pass of license header updates

* Second pass of license header updates

* Fix restore dialog issues

* Remove add additional themes menu items

* fix select box issues where the list doesn't show up

* formatting

* Fix editor dispose issue

* Copy over node modules to correct location on all platforms
This commit is contained in:
Karl Burtram
2018-04-04 15:27:51 -07:00
committed by GitHub
parent 5fba3e31b4
commit dafb780987
9412 changed files with 141255 additions and 98813 deletions

View File

@@ -10,7 +10,6 @@ import Event from 'vs/base/common/event';
import { Builder, Dimension } from 'vs/base/browser/builder';
import { Registry } from 'vs/platform/registry/common/platform';
import { ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar';
import { Scope } from 'vs/workbench/browser/actions';
import { IPanel } from 'vs/workbench/common/panel';
import { CompositePart, ICompositeTitleLabel } from 'vs/workbench/browser/parts/compositePart';
import { Panel, PanelRegistry, Extensions as PanelExtensions } from 'vs/workbench/browser/panel';
@@ -18,7 +17,6 @@ import { IPanelService, IPanelIdentifier } from 'vs/workbench/services/panel/com
import { IPartService, Parts, Position } from 'vs/workbench/services/part/common/partService';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { IMessageService } from 'vs/platform/message/common/message';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
@@ -31,6 +29,7 @@ import { ToggleCompositePinnedAction } from 'vs/workbench/browser/parts/composit
import { StandardMouseEvent } from 'vs/base/browser/mouseEvent';
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
import { IBadge } from 'vs/workbench/services/activity/common/activity';
import { INotificationService } from 'vs/platform/notification/common/notification';
export class PanelPart extends CompositePart<Panel> implements IPanelService {
@@ -47,17 +46,17 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
constructor(
id: string,
@IMessageService messageService: IMessageService,
@INotificationService notificationService: INotificationService,
@IStorageService storageService: IStorageService,
@ITelemetryService telemetryService: ITelemetryService,
@IContextMenuService contextMenuService: IContextMenuService,
@IPartService partService: IPartService,
@IKeybindingService keybindingService: IKeybindingService,
@IInstantiationService instantiationService: IInstantiationService,
@IThemeService themeService: IThemeService,
@IThemeService themeService: IThemeService
) {
super(
messageService,
notificationService,
storageService,
telemetryService,
contextMenuService,
@@ -70,7 +69,6 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
Registry.as<PanelRegistry>(PanelExtensions.Panels).getDefaultPanelId(),
'panel',
'panel',
Scope.PANEL,
null,
id,
{ hasTitle: true }
@@ -108,10 +106,10 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
// Need to relayout composite bar since different panels have different action bar width
this.layoutCompositeBar();
}));
this.toUnbind.push(this.compositeBar.onDidContextMenu(e => this.showContextMenu(e)));
// Deactivate panel action on close
this.toUnbind.push(this.onDidPanelClose(panel => this.compositeBar.deactivateComposite(panel.getId())));
this.toUnbind.push(this.compositeBar.onDidContextMenu(e => this.showContextMenu(e)));
}
public get onDidPanelOpen(): Event<IPanel> {
@@ -157,7 +155,7 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
}
private getPanel(panelId: string): IPanelIdentifier {
return Registry.as<PanelRegistry>(PanelExtensions.Panels).getPanels().filter(p => p.id === panelId).pop();
return this.getPanels().filter(p => p.id === panelId).pop();
}
private showContextMenu(e: MouseEvent): void {
@@ -173,9 +171,22 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
public getPanels(): IPanelIdentifier[] {
return Registry.as<PanelRegistry>(PanelExtensions.Panels).getPanels()
.filter(p => p.enabled)
.sort((v1, v2) => v1.order - v2.order);
}
public setPanelEnablement(id: string, enabled: boolean): void {
const descriptor = Registry.as<PanelRegistry>(PanelExtensions.Panels).getPanels().filter(p => p.id === id).pop();
if (descriptor && descriptor.enabled !== enabled) {
descriptor.enabled = enabled;
if (enabled) {
this.compositeBar.addComposite(descriptor);
} else {
this.compositeBar.removeComposite(id);
}
}
}
protected getActions(): IAction[] {
return [
this.instantiationService.createInstance(ToggleMaximizedPanelAction, ToggleMaximizedPanelAction.ID, ToggleMaximizedPanelAction.LABEL),
@@ -252,14 +263,6 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
return this.toolbarWidth.get(activePanel.getId());
}
public shutdown(): void {
// Persist Hidden State
this.compositeBar.store();
// Pass to super
super.shutdown();
}
}
registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
@@ -331,7 +334,7 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
outline-style: solid;
border-bottom: none;
padding-bottom: 0;
outline-offset: 3px;
outline-offset: 1px;
}
.monaco-workbench > .part.panel > .title > .panel-switcher-container > .monaco-action-bar .action-item:not(.checked) .action-label:hover {
@@ -339,4 +342,4 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
}
`);
}
});
});