mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-15 01:25:36 -05:00
Merge VS Code 1.23.1 (#1520)
This commit is contained in:
@@ -30,10 +30,9 @@ import { resolveCommonProperties } from 'vs/platform/telemetry/node/commonProper
|
||||
import { TelemetryAppenderChannel } from 'vs/platform/telemetry/common/telemetryIpc';
|
||||
import { TelemetryService, ITelemetryServiceConfig } from 'vs/platform/telemetry/common/telemetryService';
|
||||
import { AppInsightsAppender } from 'vs/platform/telemetry/node/appInsightsAppender';
|
||||
import { IWindowsService } from 'vs/platform/windows/common/windows';
|
||||
import { IWindowsService, ActiveWindowManager } from 'vs/platform/windows/common/windows';
|
||||
import { WindowsChannelClient } from 'vs/platform/windows/common/windowsIpc';
|
||||
import { ipcRenderer } from 'electron';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { createSharedProcessContributions } from 'vs/code/electron-browser/sharedProcess/contrib/contributions';
|
||||
import { createSpdLogService } from 'vs/platform/log/node/spdlogService';
|
||||
import { ILogService, LogLevel } from 'vs/platform/log/common/log';
|
||||
@@ -41,8 +40,8 @@ import { LogLevelSetterChannelClient, FollowerLogService } from 'vs/platform/log
|
||||
import { LocalizationsService } from 'vs/platform/localizations/node/localizations';
|
||||
import { ILocalizationsService } from 'vs/platform/localizations/common/localizations';
|
||||
import { LocalizationsChannel } from 'vs/platform/localizations/common/localizationsIpc';
|
||||
import { IChoiceService } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { ChoiceChannelClient } from 'vs/platform/dialogs/common/choiceIpc';
|
||||
import { DialogChannelClient } from 'vs/platform/dialogs/common/dialogIpc';
|
||||
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
|
||||
|
||||
export interface ISharedProcessConfiguration {
|
||||
readonly machineId: string;
|
||||
@@ -58,28 +57,6 @@ interface ISharedProcessInitData {
|
||||
logLevel: LogLevel;
|
||||
}
|
||||
|
||||
class ActiveWindowManager implements IDisposable {
|
||||
private disposables: IDisposable[] = [];
|
||||
private _activeWindowId: number;
|
||||
|
||||
constructor( @IWindowsService windowsService: IWindowsService) {
|
||||
windowsService.onWindowOpen(this.setActiveWindow, this, this.disposables);
|
||||
windowsService.onWindowFocus(this.setActiveWindow, this, this.disposables);
|
||||
}
|
||||
|
||||
private setActiveWindow(windowId: number) {
|
||||
this._activeWindowId = windowId;
|
||||
}
|
||||
|
||||
public get activeClientId(): string {
|
||||
return `window:${this._activeWindowId}`;
|
||||
}
|
||||
|
||||
public dispose() {
|
||||
this.disposables = dispose(this.disposables);
|
||||
}
|
||||
}
|
||||
|
||||
const eventPrefix = 'monacoworkbench';
|
||||
|
||||
function main(server: Server, initData: ISharedProcessInitData, configuration: ISharedProcessConfiguration): void {
|
||||
@@ -102,13 +79,13 @@ function main(server: Server, initData: ISharedProcessInitData, configuration: I
|
||||
services.set(IWindowsService, windowsService);
|
||||
|
||||
const activeWindowManager = new ActiveWindowManager(windowsService);
|
||||
const choiceChannel = server.getChannel('choice', {
|
||||
const dialogChannel = server.getChannel('dialog', {
|
||||
route: () => {
|
||||
logService.info('Routing choice request to the client', activeWindowManager.activeClientId);
|
||||
logService.info('Routing dialog request to the client', activeWindowManager.activeClientId);
|
||||
return activeWindowManager.activeClientId;
|
||||
}
|
||||
});
|
||||
services.set(IChoiceService, new ChoiceChannelClient(choiceChannel));
|
||||
services.set(IDialogService, new DialogChannelClient(dialogChannel));
|
||||
|
||||
const instantiationService = new InstantiationService(services);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user