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:
Anthony Dresser
2019-03-19 17:44:35 -07:00
committed by GitHub
parent 833d197412
commit 87765e8673
1879 changed files with 54505 additions and 38058 deletions

View File

@@ -0,0 +1,27 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Registry } from 'vs/platform/registry/common/platform';
import * as nls from 'vs/nls';
import product from 'vs/platform/product/node/product';
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions';
import { OpenIssueReporterAction, ReportPerformanceIssueUsingReporterAction, OpenProcessExplorer } from 'vs/workbench/contrib/issue/electron-browser/issueActions';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { IWorkbenchIssueService } from 'vs/workbench/contrib/issue/electron-browser/issue';
import { WorkbenchIssueService } from 'vs/workbench/contrib/issue/electron-browser/issueService';
const helpCategory = nls.localize('help', "Help");
const workbenchActionsRegistry = Registry.as<IWorkbenchActionRegistry>(Extensions.WorkbenchActions);
if (!!product.reportIssueUrl) {
workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(OpenIssueReporterAction, OpenIssueReporterAction.ID, OpenIssueReporterAction.LABEL), 'Help: Open Issue Reporter', helpCategory);
workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(ReportPerformanceIssueUsingReporterAction, ReportPerformanceIssueUsingReporterAction.ID, ReportPerformanceIssueUsingReporterAction.LABEL), 'Help: Report Performance Issue', helpCategory);
}
const developerCategory = nls.localize('developer', "Developer");
workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(OpenProcessExplorer, OpenProcessExplorer.ID, OpenProcessExplorer.LABEL), 'Developer: Open Process Explorer', developerCategory);
registerSingleton(IWorkbenchIssueService, WorkbenchIssueService, true);

View File

@@ -0,0 +1,15 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { IssueReporterData } from 'vs/platform/issue/common/issue';
export const IWorkbenchIssueService = createDecorator<IWorkbenchIssueService>('workbenchIssueService');
export interface IWorkbenchIssueService {
_serviceBrand: any;
openReporter(dataOverrides?: Partial<IssueReporterData>): Promise<void>;
openProcessExplorer(): Promise<void>;
}

View File

@@ -0,0 +1,60 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Action } from 'vs/base/common/actions';
import * as nls from 'vs/nls';
import { IssueType } from 'vs/platform/issue/common/issue';
import { IWorkbenchIssueService } from 'vs/workbench/contrib/issue/electron-browser/issue';
export class OpenIssueReporterAction extends Action {
static readonly ID = 'workbench.action.openIssueReporter';
static readonly LABEL = nls.localize({ key: 'reportIssueInEnglish', comment: ['Translate this to "Report Issue in English" in all languages please!'] }, "Report Issue");
constructor(
id: string,
label: string,
@IWorkbenchIssueService private readonly issueService: IWorkbenchIssueService
) {
super(id, label);
}
run(): Promise<boolean> {
return this.issueService.openReporter().then(() => true);
}
}
export class OpenProcessExplorer extends Action {
static readonly ID = 'workbench.action.openProcessExplorer';
static readonly LABEL = nls.localize('openProcessExplorer', "Open Process Explorer");
constructor(
id: string,
label: string,
@IWorkbenchIssueService private readonly issueService: IWorkbenchIssueService
) {
super(id, label);
}
run(): Promise<boolean> {
return this.issueService.openProcessExplorer().then(() => true);
}
}
export class ReportPerformanceIssueUsingReporterAction extends Action {
static readonly ID = 'workbench.action.reportPerformanceIssueUsingReporter';
static readonly LABEL = nls.localize('reportPerformanceIssue', "Report Performance Issue");
constructor(
id: string,
label: string,
@IWorkbenchIssueService private readonly issueService: IWorkbenchIssueService
) {
super(id, label);
}
run(): Promise<boolean> {
return this.issueService.openReporter({ issueType: IssueType.PerformanceIssue }).then(() => true);
}
}

View File

@@ -0,0 +1,100 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IssueReporterStyles, IIssueService, IssueReporterData, ProcessExplorerData, IssueReporterExtensionData } from 'vs/platform/issue/common/issue';
import { ITheme, IThemeService } from 'vs/platform/theme/common/themeService';
import { textLinkForeground, inputBackground, inputBorder, inputForeground, buttonBackground, buttonHoverBackground, buttonForeground, inputValidationErrorBorder, foreground, inputActiveOptionBorder, scrollbarSliderActiveBackground, scrollbarSliderBackground, scrollbarSliderHoverBackground, editorBackground, editorForeground, listHoverBackground, listHoverForeground, listHighlightForeground, textLinkActiveForeground } from 'vs/platform/theme/common/colorRegistry';
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
import { IExtensionManagementService, IExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement';
import { webFrame } from 'electron';
import { assign } from 'vs/base/common/objects';
import { IWorkbenchIssueService } from 'vs/workbench/contrib/issue/electron-browser/issue';
import { IWindowService } from 'vs/platform/windows/common/windows';
import { ExtensionType } from 'vs/platform/extensions/common/extensions';
export class WorkbenchIssueService implements IWorkbenchIssueService {
_serviceBrand: any;
constructor(
@IIssueService private readonly issueService: IIssueService,
@IThemeService private readonly themeService: IThemeService,
@IExtensionManagementService private readonly extensionManagementService: IExtensionManagementService,
@IExtensionEnablementService private readonly extensionEnablementService: IExtensionEnablementService,
@IWindowService private readonly windowService: IWindowService
) { }
openReporter(dataOverrides: Partial<IssueReporterData> = {}): Promise<void> {
return this.extensionManagementService.getInstalled(ExtensionType.User).then(extensions => {
const enabledExtensions = extensions.filter(extension => this.extensionEnablementService.isEnabled(extension));
const extensionData: IssueReporterExtensionData[] = enabledExtensions.map(extension => {
const { manifest } = extension;
const manifestKeys = manifest.contributes ? Object.keys(manifest.contributes) : [];
const isTheme = !manifest.activationEvents && manifestKeys.length === 1 && manifestKeys[0] === 'themes';
return {
name: manifest.name,
publisher: manifest.publisher,
version: manifest.version,
repositoryUrl: manifest.repository && manifest.repository.url,
bugsUrl: manifest.bugs && manifest.bugs.url,
displayName: manifest.displayName,
id: extension.identifier.id,
isTheme: isTheme
};
});
const theme = this.themeService.getTheme();
const issueReporterData: IssueReporterData = assign(
{
styles: getIssueReporterStyles(theme),
zoomLevel: webFrame.getZoomLevel(),
enabledExtensions: extensionData
},
dataOverrides);
return this.issueService.openReporter(issueReporterData);
});
}
openProcessExplorer(): Promise<void> {
const theme = this.themeService.getTheme();
const data: ProcessExplorerData = {
pid: this.windowService.getConfiguration().mainPid,
zoomLevel: webFrame.getZoomLevel(),
styles: {
backgroundColor: getColor(theme, editorBackground),
color: getColor(theme, editorForeground),
hoverBackground: getColor(theme, listHoverBackground),
hoverForeground: getColor(theme, listHoverForeground),
highlightForeground: getColor(theme, listHighlightForeground),
}
};
return this.issueService.openProcessExplorer(data);
}
}
export function getIssueReporterStyles(theme: ITheme): IssueReporterStyles {
return {
backgroundColor: getColor(theme, SIDE_BAR_BACKGROUND),
color: getColor(theme, foreground),
textLinkColor: getColor(theme, textLinkForeground),
textLinkActiveForeground: getColor(theme, textLinkActiveForeground),
inputBackground: getColor(theme, inputBackground),
inputForeground: getColor(theme, inputForeground),
inputBorder: getColor(theme, inputBorder),
inputActiveBorder: getColor(theme, inputActiveOptionBorder),
inputErrorBorder: getColor(theme, inputValidationErrorBorder),
buttonBackground: getColor(theme, buttonBackground),
buttonForeground: getColor(theme, buttonForeground),
buttonHoverBackground: getColor(theme, buttonHoverBackground),
sliderActiveColor: getColor(theme, scrollbarSliderActiveBackground),
sliderBackgroundColor: getColor(theme, scrollbarSliderBackground),
sliderHoverColor: getColor(theme, scrollbarSliderHoverBackground),
};
}
function getColor(theme: ITheme, key: string): string | undefined {
const color = theme.getColor(key);
return color ? color.toString() : undefined;
}