Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
8c93891a
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
8c93891a
编写于
11月 17, 2020
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Minor renames
上级
28b16c26
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
15 addition
and
15 deletion
+15
-15
src/vs/code/electron-main/app.ts
src/vs/code/electron-main/app.ts
+5
-5
src/vs/platform/keyboardLayout/common/keyboardLayoutMainService.ts
...atform/keyboardLayout/common/keyboardLayoutMainService.ts
+1
-1
src/vs/platform/keyboardLayout/electron-main/keyboardLayoutMainService.ts
...keyboardLayout/electron-main/keyboardLayoutMainService.ts
+4
-4
src/vs/workbench/services/keybinding/electron-sandbox/nativeKeyboardLayout.ts
...vices/keybinding/electron-sandbox/nativeKeyboardLayout.ts
+5
-5
未找到文件。
src/vs/code/electron-main/app.ts
浏览文件 @
8c93891a
...
...
@@ -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
{
I
MainKeyboardLayoutService
,
MainKeyboardLayout
Service
}
from
'
vs/platform/keyboardLayout/electron-main/keyboardLayoutMainService
'
;
import
{
I
KeyboardLayoutMainService
,
KeyboardLayoutMain
Service
}
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
(
I
MainKeyboardLayoutService
,
new
SyncDescriptor
(
MainKeyboardLayout
Service
));
services
.
set
(
I
KeyboardLayoutMainService
,
new
SyncDescriptor
(
KeyboardLayoutMain
Service
));
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
(
IMainKeyboardLayout
Service
);
const
mainKeyboardLayoutChannel
=
createChannelReceiver
(
mainKeyboardLayout
Service
);
electronIpcServer
.
registerChannel
(
'
mainKeyboardLayout
'
,
mainK
eyboardLayoutChannel
);
const
keyboardLayoutMainService
=
accessor
.
get
(
IKeyboardLayoutMain
Service
);
const
keyboardLayoutChannel
=
createChannelReceiver
(
keyboardLayoutMain
Service
);
electronIpcServer
.
registerChannel
(
'
keyboardLayout
'
,
k
eyboardLayoutChannel
);
const
nativeHostMainService
=
this
.
nativeHostMainService
=
accessor
.
get
(
INativeHostMainService
);
const
nativeHostChannel
=
createChannelReceiver
(
this
.
nativeHostMainService
);
...
...
src/vs/platform/keyboardLayout/common/keyboardLayoutMainService.ts
浏览文件 @
8c93891a
...
...
@@ -11,7 +11,7 @@ export interface IKeyboardLayoutData {
keyboardMapping
:
IKeyboardMapping
;
}
export
interface
I
MainKeyboardLayout
Service
{
export
interface
I
KeyboardLayoutMain
Service
{
readonly
_serviceBrand
:
undefined
;
readonly
onDidChangeKeyboardLayout
:
Event
<
IKeyboardLayoutData
>
;
getKeyboardLayoutData
():
Promise
<
IKeyboardLayoutData
>
;
...
...
src/vs/platform/keyboardLayout/electron-main/keyboardLayoutMainService.ts
浏览文件 @
8c93891a
...
...
@@ -4,16 +4,16 @@
*--------------------------------------------------------------------------------------------*/
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IKeyboardLayoutData
,
I
MainKeyboardLayoutService
as
ICommonMainKeyboardLayout
Service
}
from
'
vs/platform/keyboardLayout/common/keyboardLayoutMainService
'
;
import
{
IKeyboardLayoutData
,
I
KeyboardLayoutMainService
as
ICommonKeyboardLayoutMain
Service
}
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
I
MainKeyboardLayoutService
=
createDecorator
<
IMainKeyboardLayoutService
>
(
'
encryption
MainService
'
);
export
const
I
KeyboardLayoutMainService
=
createDecorator
<
IKeyboardLayoutMainService
>
(
'
keyboardLayout
MainService
'
);
export
interface
I
MainKeyboardLayoutService
extends
ICommonMainKeyboardLayout
Service
{
}
export
interface
I
KeyboardLayoutMainService
extends
ICommonKeyboardLayoutMain
Service
{
}
export
class
MainKeyboardLayoutService
extends
Disposable
implements
ICommonMainKeyboardLayout
Service
{
export
class
KeyboardLayoutMainService
extends
Disposable
implements
ICommonKeyboardLayoutMain
Service
{
declare
readonly
_serviceBrand
:
undefined
;
...
...
src/vs/workbench/services/keybinding/electron-sandbox/nativeKeyboardLayout.ts
浏览文件 @
8c93891a
...
...
@@ -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
{
I
MainKeyboardLayout
Service
}
from
'
vs/platform/keyboardLayout/common/keyboardLayoutMainService
'
;
import
{
I
KeyboardLayoutMain
Service
}
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
:
IMainKeyboardLayout
Service
;
private
readonly
_
keyboardLayoutMainService
:
IKeyboardLayoutMain
Service
;
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
(
'
mainK
eyboardLayout
'
));
this
.
_
keyboardLayoutMainService
=
createChannelSender
<
IKeyboardLayoutMainService
>
(
mainProcessService
.
getChannel
(
'
k
eyboardLayout
'
));
this
.
_initPromise
=
null
;
this
.
_keyboardMapping
=
null
;
this
.
_keyboardLayoutInfo
=
null
;
this
.
_keyboardMapper
=
new
MacLinuxFallbackKeyboardMapper
(
OS
);
this
.
_register
(
this
.
_
mainKeyboardLayout
Service
.
onDidChangeKeyboardLayout
(
async
({
keyboardLayoutInfo
,
keyboardMapping
})
=>
{
this
.
_register
(
this
.
_
keyboardLayoutMain
Service
.
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
.
_
mainKeyboardLayout
Service
.
getKeyboardLayoutData
();
const
keyboardLayoutData
=
await
this
.
_
keyboardLayoutMain
Service
.
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录