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

@@ -109,7 +109,7 @@ export class ChartViewerComponent implements OnInit, OnDestroy, IChartViewAction
this._initActionBar();
// Init chart type dropdown
this.chartTypesSelectBox = new SelectBox(insightRegistry.getAllIds(), this.getDefaultChartType());
this.chartTypesSelectBox = new SelectBox(insightRegistry.getAllIds(), this.getDefaultChartType(), this._bootstrapService.contextViewService);
this.chartTypesSelectBox.render(this.chartTypesElement.nativeElement);
this.chartTypesSelectBox.onDidSelect(selected => this.onChartChanged());
this._disposables.push(attachSelectBoxStyler(this.chartTypesSelectBox, this._bootstrapService.themeService));
@@ -129,7 +129,7 @@ export class ChartViewerComponent implements OnInit, OnDestroy, IChartViewAction
});
// Init legend dropdown
this.legendSelectBox = new SelectBox(this.legendOptions, this._chartConfig.legendPosition);
this.legendSelectBox = new SelectBox(this.legendOptions, this._chartConfig.legendPosition, this._bootstrapService.contextViewService);
this.legendSelectBox.render(this.legendElement.nativeElement);
this.legendSelectBox.onDidSelect(selected => this.onLegendChanged());
this._disposables.push(attachSelectBoxStyler(this.legendSelectBox, this._bootstrapService.themeService));
@@ -209,35 +209,37 @@ export class ChartViewerComponent implements OnInit, OnDestroy, IChartViewAction
}
public saveChart(): void {
let filePath = this.promptForFilepath();
let data = this._chartComponent.getCanvasData();
if (!data) {
this.showError(this.chartNotFoundError);
return;
}
if (filePath) {
let buffer = this.decodeBase64Image(data);
pfs.writeFile(filePath, buffer).then(undefined, (err) => {
if (err) {
this.showError(err.message);
} else {
let fileUri = URI.from({ scheme: PathUtilities.FILE_SCHEMA, path: filePath });
this._bootstrapService.windowsService.openExternal(fileUri.toString());
this._bootstrapService.messageService.show(Severity.Info, nls.localize('chartSaved', 'Saved Chart to path: {0}', filePath));
}
});
}
this.promptForFilepath().then(filePath => {
let data = this._chartComponent.getCanvasData();
if (!data) {
this.showError(this.chartNotFoundError);
return;
}
if (filePath) {
let buffer = this.decodeBase64Image(data);
pfs.writeFile(filePath, buffer).then(undefined, (err) => {
if (err) {
this.showError(err.message);
} else {
let fileUri = URI.from({ scheme: PathUtilities.FILE_SCHEMA, path: filePath });
this._bootstrapService.windowsService.openExternal(fileUri.toString());
this._bootstrapService.notificationService.notify({
severity: Severity.Error,
message: nls.localize('chartSaved', 'Saved Chart to path: {0}', filePath)
});
}
});
}
});
}
private promptForFilepath(): string {
private promptForFilepath(): Thenable<string> {
let filepathPlaceHolder = PathUtilities.resolveCurrentDirectory(this.getActiveUriString(), PathUtilities.getRootPath(this._bootstrapService.workspaceContextService));
filepathPlaceHolder = paths.join(filepathPlaceHolder, 'chart.png');
let filePath: string = this._bootstrapService.windowService.showSaveDialog({
return this._bootstrapService.windowService.showSaveDialog({
title: nls.localize('chartViewer.saveAsFileTitle', 'Choose Results File'),
defaultPath: paths.normalize(filepathPlaceHolder, true)
});
return filePath;
}
private decodeBase64Image(data: string): Buffer {
@@ -282,7 +284,10 @@ export class ChartViewerComponent implements OnInit, OnDestroy, IChartViewAction
}
private showError(errorMsg: string) {
this._bootstrapService.messageService.show(Severity.Error, errorMsg);
this._bootstrapService.notificationService.notify({
severity: Severity.Error,
message: errorMsg
});
}
private getGridItemConfig(): NgGridItemConfig {

View File

@@ -6,8 +6,8 @@
import { TPromise } from 'vs/base/common/winjs.base';
import { Action } from 'vs/base/common/actions';
import * as nls from 'vs/nls';
import { IMessageService, Severity } from 'vs/platform/message/common/message';
import { INotificationService } from 'vs/platform/notification/common/notification';
import Severity from 'vs/base/common/severity';
export interface IChartViewActionContext {
copyChart(): void;
@@ -23,7 +23,7 @@ export class ChartViewActionBase extends Action {
id: string,
label: string,
enabledClass: string,
protected messageService: IMessageService
protected notificationService: INotificationService
) {
super(id, label);
this.enabled = true;
@@ -51,7 +51,10 @@ export class ChartViewActionBase extends Action {
protected doRun(context: IChartViewActionContext, runAction: Function): TPromise<boolean> {
if (!context) {
// TODO implement support for finding chart view in active window
this.messageService.show(Severity.Error, nls.localize('chartContextRequired', 'Chart View context is required to run this action'));
this.notificationService.notify({
severity: Severity.Error,
message: nls.localize('chartContextRequired', 'Chart View context is required to run this action')
});
return TPromise.as(false);
}
return new TPromise<boolean>((resolve, reject) => {
@@ -66,9 +69,9 @@ export class CreateInsightAction extends ChartViewActionBase {
public static ID = 'chartview.createInsight';
public static LABEL = nls.localize('createInsightLabel', "Create Insight");
constructor(@IMessageService messageService: IMessageService
constructor(@INotificationService notificationService: INotificationService
) {
super(CreateInsightAction.ID, CreateInsightAction.LABEL, 'createInsight', messageService);
super(CreateInsightAction.ID, CreateInsightAction.LABEL, 'createInsight', notificationService);
}
public run(context: IChartViewActionContext): TPromise<boolean> {
@@ -80,9 +83,9 @@ export class CopyAction extends ChartViewActionBase {
public static ID = 'chartview.copy';
public static LABEL = nls.localize('copyChartLabel', "Copy as image");
constructor(@IMessageService messageService: IMessageService
constructor(@INotificationService notificationService: INotificationService
) {
super(CopyAction.ID, CopyAction.LABEL, 'copyImage', messageService);
super(CopyAction.ID, CopyAction.LABEL, 'copyImage', notificationService);
}
public run(context: IChartViewActionContext): TPromise<boolean> {
@@ -94,9 +97,9 @@ export class SaveImageAction extends ChartViewActionBase {
public static ID = 'chartview.saveImage';
public static LABEL = nls.localize('saveImageLabel', "Save as image");
constructor(@IMessageService messageService: IMessageService
constructor(@INotificationService notificationService: INotificationService
) {
super(SaveImageAction.ID, SaveImageAction.LABEL, 'saveAsImage', messageService);
super(SaveImageAction.ID, SaveImageAction.LABEL, 'saveAsImage', notificationService);
}
public run(context: IChartViewActionContext): TPromise<boolean> {