mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-09 01:32:34 -05:00
Merge from vscode 817eb6b0c720a4ecbc13c020afbbebfed667aa09 (#7356)
This commit is contained in:
@@ -7,15 +7,14 @@ import { localize } from 'vs/nls';
|
||||
import * as objects from 'vs/base/common/objects';
|
||||
import { parseArgs, OPTIONS } from 'vs/platform/environment/node/argv';
|
||||
import { IIssueService, IssueReporterData, IssueReporterFeatures, ProcessExplorerData } from 'vs/platform/issue/node/issue';
|
||||
import { BrowserWindow, ipcMain, screen, dialog } from 'electron';
|
||||
import { ILaunchMainService } from 'vs/platform/launch/electron-main/launchService';
|
||||
import { BrowserWindow, ipcMain, screen, dialog, IpcMainEvent, Display } from 'electron';
|
||||
import { ILaunchMainService } from 'vs/platform/launch/electron-main/launchMainService';
|
||||
import { PerformanceInfo, isRemoteDiagnosticError } from 'vs/platform/diagnostics/common/diagnostics';
|
||||
import { IDiagnosticsService } from 'vs/platform/diagnostics/node/diagnosticsService';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { isMacintosh, IProcessEnvironment } from 'vs/base/common/platform';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IWindowsService } from 'vs/platform/windows/common/windows';
|
||||
import { IWindowState } from 'vs/platform/windows/electron-main/windows';
|
||||
import { IWindowState, IWindowsMainService } from 'vs/platform/windows/electron-main/windows';
|
||||
import { listProcesses } from 'vs/base/node/ps';
|
||||
|
||||
const DEFAULT_BACKGROUND_COLOR = '#1E1E1E';
|
||||
@@ -34,13 +33,13 @@ export class IssueMainService implements IIssueService {
|
||||
@ILaunchMainService private readonly launchMainService: ILaunchMainService,
|
||||
@ILogService private readonly logService: ILogService,
|
||||
@IDiagnosticsService private readonly diagnosticsService: IDiagnosticsService,
|
||||
@IWindowsService private readonly windowsService: IWindowsService
|
||||
@IWindowsMainService private readonly windowsMainService: IWindowsMainService
|
||||
) {
|
||||
this.registerListeners();
|
||||
}
|
||||
|
||||
private registerListeners(): void {
|
||||
ipcMain.on('vscode:issueSystemInfoRequest', async (event: Electron.IpcMainEvent) => {
|
||||
ipcMain.on('vscode:issueSystemInfoRequest', async (event: IpcMainEvent) => {
|
||||
Promise.all([this.launchMainService.getMainProcessInfo(), this.launchMainService.getRemoteDiagnostics({ includeProcesses: false, includeWorkspaceMetadata: false })])
|
||||
.then(result => {
|
||||
const [info, remoteData] = result;
|
||||
@@ -50,7 +49,7 @@ export class IssueMainService implements IIssueService {
|
||||
});
|
||||
});
|
||||
|
||||
ipcMain.on('vscode:listProcesses', async (event: Electron.IpcMainEvent) => {
|
||||
ipcMain.on('vscode:listProcesses', async (event: IpcMainEvent) => {
|
||||
const processes = [];
|
||||
|
||||
try {
|
||||
@@ -79,7 +78,7 @@ export class IssueMainService implements IIssueService {
|
||||
event.sender.send('vscode:listProcessesResponse', processes);
|
||||
});
|
||||
|
||||
ipcMain.on('vscode:issueReporterClipboard', (event: Electron.IpcMainEvent) => {
|
||||
ipcMain.on('vscode:issueReporterClipboard', (event: IpcMainEvent) => {
|
||||
const messageOptions = {
|
||||
message: localize('issueReporterWriteToClipboard', "There is too much data to send to GitHub. Would you like to write the information to the clipboard so that it can be pasted?"),
|
||||
type: 'warning',
|
||||
@@ -97,7 +96,7 @@ export class IssueMainService implements IIssueService {
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.on('vscode:issuePerformanceInfoRequest', (event: Electron.IpcMainEvent) => {
|
||||
ipcMain.on('vscode:issuePerformanceInfoRequest', (event: IpcMainEvent) => {
|
||||
this.getPerformanceInfo().then(msg => {
|
||||
event.sender.send('vscode:issuePerformanceInfoResponse', msg);
|
||||
});
|
||||
@@ -147,16 +146,16 @@ export class IssueMainService implements IIssueService {
|
||||
});
|
||||
|
||||
ipcMain.on('vscode:openExternal', (_: unknown, arg: string) => {
|
||||
this.windowsService.openExternal(arg);
|
||||
this.windowsMainService.openExternal(arg);
|
||||
});
|
||||
|
||||
ipcMain.on('vscode:closeIssueReporter', (event: Electron.IpcMainEvent) => {
|
||||
ipcMain.on('vscode:closeIssueReporter', (event: IpcMainEvent) => {
|
||||
if (this._issueWindow) {
|
||||
this._issueWindow.close();
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.on('windowsInfoRequest', (event: Electron.IpcMainEvent) => {
|
||||
ipcMain.on('windowsInfoRequest', (event: IpcMainEvent) => {
|
||||
this.launchMainService.getMainProcessInfo().then(info => {
|
||||
event.sender.send('vscode:windowsInfoResponse', info.windows);
|
||||
});
|
||||
@@ -277,7 +276,7 @@ export class IssueMainService implements IIssueService {
|
||||
|
||||
private getWindowPosition(parentWindow: BrowserWindow, defaultWidth: number, defaultHeight: number): IWindowState {
|
||||
// We want the new window to open on the same display that the parent is in
|
||||
let displayToUse: Electron.Display | undefined;
|
||||
let displayToUse: Display | undefined;
|
||||
const displays = screen.getAllDisplays();
|
||||
|
||||
// Single Display
|
||||
|
||||
Reference in New Issue
Block a user