未验证 提交 8c93891a 编写于 作者: A Alex Dima

Minor renames

上级 28b16c26
......@@ -82,7 +82,7 @@ import { generateUuid } from 'vs/base/common/uuid';
import { VSBuffer } from 'vs/base/common/buffer';
import { EncryptionMainService, IEncryptionMainService } from 'vs/platform/encryption/electron-main/encryptionMainService';
import { ActiveWindowManager } from 'vs/platform/windows/common/windowTracker';
import { IMainKeyboardLayoutService, MainKeyboardLayoutService } from 'vs/platform/keyboardLayout/electron-main/keyboardLayoutMainService';
import { IKeyboardLayoutMainService, KeyboardLayoutMainService } from 'vs/platform/keyboardLayout/electron-main/keyboardLayoutMainService';
export class CodeApplication extends Disposable {
private windowsMainService: IWindowsMainService | undefined;
......@@ -431,7 +431,7 @@ export class CodeApplication extends Disposable {
services.set(IIssueMainService, new SyncDescriptor(IssueMainService, [machineId, this.userEnv]));
services.set(IEncryptionMainService, new SyncDescriptor(EncryptionMainService, [machineId]));
services.set(IMainKeyboardLayoutService, new SyncDescriptor(MainKeyboardLayoutService));
services.set(IKeyboardLayoutMainService, new SyncDescriptor(KeyboardLayoutMainService));
services.set(INativeHostMainService, new SyncDescriptor(NativeHostMainService));
services.set(IWebviewManagerService, new SyncDescriptor(WebviewMainService));
services.set(IWorkspacesService, new SyncDescriptor(WorkspacesService));
......@@ -522,9 +522,9 @@ export class CodeApplication extends Disposable {
const encryptionChannel = createChannelReceiver(encryptionMainService);
electronIpcServer.registerChannel('encryption', encryptionChannel);
const mainKeyboardLayoutService = accessor.get(IMainKeyboardLayoutService);
const mainKeyboardLayoutChannel = createChannelReceiver(mainKeyboardLayoutService);
electronIpcServer.registerChannel('mainKeyboardLayout', mainKeyboardLayoutChannel);
const keyboardLayoutMainService = accessor.get(IKeyboardLayoutMainService);
const keyboardLayoutChannel = createChannelReceiver(keyboardLayoutMainService);
electronIpcServer.registerChannel('keyboardLayout', keyboardLayoutChannel);
const nativeHostMainService = this.nativeHostMainService = accessor.get(INativeHostMainService);
const nativeHostChannel = createChannelReceiver(this.nativeHostMainService);
......
......@@ -11,7 +11,7 @@ export interface IKeyboardLayoutData {
keyboardMapping: IKeyboardMapping;
}
export interface IMainKeyboardLayoutService {
export interface IKeyboardLayoutMainService {
readonly _serviceBrand: undefined;
readonly onDidChangeKeyboardLayout: Event<IKeyboardLayoutData>;
getKeyboardLayoutData(): Promise<IKeyboardLayoutData>;
......
......@@ -4,16 +4,16 @@
*--------------------------------------------------------------------------------------------*/
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { IKeyboardLayoutData, IMainKeyboardLayoutService as ICommonMainKeyboardLayoutService } from 'vs/platform/keyboardLayout/common/keyboardLayoutMainService';
import { IKeyboardLayoutData, IKeyboardLayoutMainService as ICommonKeyboardLayoutMainService } from 'vs/platform/keyboardLayout/common/keyboardLayoutMainService';
import { Emitter } from 'vs/base/common/event';
import { Disposable } from 'vs/base/common/lifecycle';
import * as nativeKeymap from 'native-keymap';
export const IMainKeyboardLayoutService = createDecorator<IMainKeyboardLayoutService>('encryptionMainService');
export const IKeyboardLayoutMainService = createDecorator<IKeyboardLayoutMainService>('keyboardLayoutMainService');
export interface IMainKeyboardLayoutService extends ICommonMainKeyboardLayoutService { }
export interface IKeyboardLayoutMainService extends ICommonKeyboardLayoutMainService { }
export class MainKeyboardLayoutService extends Disposable implements ICommonMainKeyboardLayoutService {
export class KeyboardLayoutMainService extends Disposable implements ICommonKeyboardLayoutMainService {
declare readonly _serviceBrand: undefined;
......
......@@ -14,7 +14,7 @@ import { MacLinuxKeyboardMapper } from 'vs/workbench/services/keybinding/common/
import { DispatchConfig } from 'vs/platform/keyboardLayout/common/dispatchConfig';
import { IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding';
import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/mainProcessService';
import { IMainKeyboardLayoutService } from 'vs/platform/keyboardLayout/common/keyboardLayoutMainService';
import { IKeyboardLayoutMainService } from 'vs/platform/keyboardLayout/common/keyboardLayoutMainService';
import { createChannelSender } from 'vs/base/parts/ipc/common/ipc';
export class KeyboardLayoutService extends Disposable implements IKeyboardLayoutService {
......@@ -24,7 +24,7 @@ export class KeyboardLayoutService extends Disposable implements IKeyboardLayout
private readonly _onDidChangeKeyboardLayout = this._register(new Emitter<void>());
readonly onDidChangeKeyboardLayout = this._onDidChangeKeyboardLayout.event;
private readonly _mainKeyboardLayoutService: IMainKeyboardLayoutService;
private readonly _keyboardLayoutMainService: IKeyboardLayoutMainService;
private _initPromise: Promise<void> | null;
private _keyboardMapping: IKeyboardMapping | null;
private _keyboardLayoutInfo: IKeyboardLayoutInfo | null;
......@@ -34,13 +34,13 @@ export class KeyboardLayoutService extends Disposable implements IKeyboardLayout
@IMainProcessService mainProcessService: IMainProcessService
) {
super();
this._mainKeyboardLayoutService = createChannelSender<IMainKeyboardLayoutService>(mainProcessService.getChannel('mainKeyboardLayout'));
this._keyboardLayoutMainService = createChannelSender<IKeyboardLayoutMainService>(mainProcessService.getChannel('keyboardLayout'));
this._initPromise = null;
this._keyboardMapping = null;
this._keyboardLayoutInfo = null;
this._keyboardMapper = new MacLinuxFallbackKeyboardMapper(OS);
this._register(this._mainKeyboardLayoutService.onDidChangeKeyboardLayout(async ({ keyboardLayoutInfo, keyboardMapping }) => {
this._register(this._keyboardLayoutMainService.onDidChangeKeyboardLayout(async ({ keyboardLayoutInfo, keyboardMapping }) => {
await this.initialize();
if (keyboardMappingEquals(this._keyboardMapping, keyboardMapping)) {
// the mappings are equal
......@@ -62,7 +62,7 @@ export class KeyboardLayoutService extends Disposable implements IKeyboardLayout
}
private async _doInitialize(): Promise<void> {
const keyboardLayoutData = await this._mainKeyboardLayoutService.getKeyboardLayoutData();
const keyboardLayoutData = await this._keyboardLayoutMainService.getKeyboardLayoutData();
const { keyboardLayoutInfo, keyboardMapping } = keyboardLayoutData;
this._keyboardMapping = keyboardMapping;
this._keyboardLayoutInfo = keyboardLayoutInfo;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册