Merge VS Code 1.23.1 (#1520)

This commit is contained in:
Matt Irvine
2018-06-05 11:24:51 -07:00
committed by GitHub
parent e3baf5c443
commit 0c58f09e59
3651 changed files with 74249 additions and 48599 deletions

View File

@@ -11,6 +11,15 @@ import { ILocalExtension } from 'vs/platform/extensionManagement/common/extensio
export const IIssueService = createDecorator<IIssueService>('issueService');
export interface WindowStyles {
backgroundColor: string;
color: string;
}
export interface WindowData {
styles: WindowStyles;
zoomLevel: number;
}
export enum IssueType {
Bug,
PerformanceIssue,
@@ -18,9 +27,7 @@ export enum IssueType {
SettingsSearchIssue
}
export interface IssueReporterStyles {
backgroundColor: string;
color: string;
export interface IssueReporterStyles extends WindowStyles {
textLinkColor: string;
inputBackground: string;
inputForeground: string;
@@ -35,9 +42,8 @@ export interface IssueReporterStyles {
sliderActiveColor: string;
}
export interface IssueReporterData {
export interface IssueReporterData extends WindowData {
styles: IssueReporterStyles;
zoomLevel: number;
enabledExtensions: ILocalExtension[];
issueType?: IssueType;
}
@@ -58,7 +64,18 @@ export interface ISettingsSearchIssueReporterData extends IssueReporterData {
export interface IssueReporterFeatures {
}
export interface ProcessExplorerStyles extends WindowStyles {
hoverBackground: string;
hoverForeground: string;
highlightForeground: string;
}
export interface ProcessExplorerData extends WindowData {
styles: ProcessExplorerStyles;
}
export interface IIssueService {
_serviceBrand: any;
openReporter(data: IssueReporterData): TPromise<void>;
openProcessExplorer(data: ProcessExplorerData): TPromise<void>;
}

View File

@@ -7,7 +7,7 @@
import { TPromise } from 'vs/base/common/winjs.base';
import { IChannel } from 'vs/base/parts/ipc/common/ipc';
import { IIssueService, IssueReporterData } from './issue';
import { IIssueService, IssueReporterData, ProcessExplorerData } from './issue';
export interface IIssueChannel extends IChannel {
call(command: 'openIssueReporter', arg: IssueReporterData): TPromise<void>;
@@ -23,6 +23,8 @@ export class IssueChannel implements IIssueChannel {
switch (command) {
case 'openIssueReporter':
return this.service.openReporter(arg);
case 'openProcessExplorer':
return this.service.openProcessExplorer(arg);
}
return undefined;
}
@@ -37,4 +39,8 @@ export class IssueChannelClient implements IIssueService {
openReporter(data: IssueReporterData): TPromise<void> {
return this.channel.call('openIssueReporter', data);
}
openProcessExplorer(data: ProcessExplorerData): TPromise<void> {
return this.channel.call('openProcessExplorer', data);
}
}

View File

@@ -9,12 +9,12 @@ import { TPromise, Promise } from 'vs/base/common/winjs.base';
import { localize } from 'vs/nls';
import * as objects from 'vs/base/common/objects';
import { parseArgs } from 'vs/platform/environment/node/argv';
import { IIssueService, IssueReporterData, IssueReporterFeatures } from 'vs/platform/issue/common/issue';
import { IIssueService, IssueReporterData, IssueReporterFeatures, ProcessExplorerData } from 'vs/platform/issue/common/issue';
import { BrowserWindow, ipcMain, screen } from 'electron';
import { ILaunchService } from 'vs/code/electron-main/launch';
import { getPerformanceInfo, PerformanceInfo, getSystemInfo, SystemInfo } from 'vs/code/electron-main/diagnostics';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { isMacintosh } from 'vs/base/common/platform';
import { isMacintosh, IProcessEnvironment } from 'vs/base/common/platform';
import { ILogService } from 'vs/platform/log/common/log';
const DEFAULT_BACKGROUND_COLOR = '#1E1E1E';
@@ -22,13 +22,15 @@ const DEFAULT_BACKGROUND_COLOR = '#1E1E1E';
export class IssueService implements IIssueService {
_serviceBrand: any;
_issueWindow: BrowserWindow;
_parentWindow: BrowserWindow;
_issueParentWindow: BrowserWindow;
_processExplorerWindow: BrowserWindow;
constructor(
private machineId: string,
private userEnv: IProcessEnvironment,
@IEnvironmentService private environmentService: IEnvironmentService,
@ILaunchService private launchService: ILaunchService,
@ILogService private logService: ILogService
@ILogService private logService: ILogService,
) { }
openReporter(data: IssueReporterData): TPromise<void> {
@@ -45,11 +47,11 @@ export class IssueService implements IIssueService {
});
ipcMain.on('workbenchCommand', (event, arg) => {
this._parentWindow.webContents.send('vscode:runAction', { id: arg, from: 'issueReporter' });
this._issueParentWindow.webContents.send('vscode:runAction', { id: arg, from: 'issueReporter' });
});
this._parentWindow = BrowserWindow.getFocusedWindow();
const position = this.getWindowPosition();
this._issueParentWindow = BrowserWindow.getFocusedWindow();
const position = this.getWindowPosition(this._issueParentWindow, 800, 900);
this._issueWindow = new BrowserWindow({
width: position.width,
height: position.height,
@@ -72,7 +74,54 @@ export class IssueService implements IIssueService {
return TPromise.as(null);
}
private getWindowPosition() {
openProcessExplorer(data: ProcessExplorerData): TPromise<void> {
// Create as singleton
if (!this._processExplorerWindow) {
const position = this.getWindowPosition(BrowserWindow.getFocusedWindow(), 800, 300);
this._processExplorerWindow = new BrowserWindow({
skipTaskbar: true,
resizable: true,
width: position.width,
height: position.height,
minWidth: 300,
minHeight: 200,
x: position.x,
y: position.y,
backgroundColor: data.styles.backgroundColor,
title: localize('processExplorer', "Process Explorer")
});
this._processExplorerWindow.setMenuBarVisibility(false);
const windowConfiguration = {
appRoot: this.environmentService.appRoot,
nodeCachedDataDir: this.environmentService.nodeCachedDataDir,
windowId: this._processExplorerWindow.id,
userEnv: this.userEnv,
machineId: this.machineId,
data
};
const environment = parseArgs(process.argv);
const config = objects.assign(environment, windowConfiguration);
for (let key in config) {
if (config[key] === void 0 || config[key] === null || config[key] === '') {
delete config[key]; // only send over properties that have a true value
}
}
this._processExplorerWindow.loadURL(`${require.toUrl('vs/code/electron-browser/processExplorer/processExplorer.html')}?config=${encodeURIComponent(JSON.stringify(config))}`);
this._processExplorerWindow.on('close', () => this._processExplorerWindow = void 0);
}
// Focus
this._processExplorerWindow.focus();
return TPromise.as(null);
}
private getWindowPosition(parentWindow: BrowserWindow, defaultWidth: number, defaultHeight: number) {
// We want the new window to open on the same display that the parent is in
let displayToUse: Electron.Display;
const displays = screen.getAllDisplays();
@@ -92,8 +141,8 @@ export class IssueService implements IIssueService {
}
// if we have a last active window, use that display for the new window
if (!displayToUse && this._parentWindow) {
displayToUse = screen.getDisplayMatching(this._parentWindow.getBounds());
if (!displayToUse && parentWindow) {
displayToUse = screen.getDisplayMatching(parentWindow.getBounds());
}
// fallback to primary display or first display
@@ -103,8 +152,8 @@ export class IssueService implements IIssueService {
}
let state = {
width: 800,
height: 900,
width: defaultWidth,
height: defaultHeight,
x: undefined,
y: undefined
};
@@ -171,6 +220,7 @@ export class IssueService implements IIssueService {
nodeCachedDataDir: this.environmentService.nodeCachedDataDir,
windowId: this._issueWindow.id,
machineId: this.machineId,
userEnv: this.userEnv,
data,
features
};