Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
93c52c48
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,发现更多精彩内容 >>
提交
93c52c48
编写于
3月 17, 2017
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Introduce and adopt RuntimeKeybinding
上级
bb508d8e
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
191 addition
and
107 deletion
+191
-107
src/vs/base/common/keyCodes.ts
src/vs/base/common/keyCodes.ts
+62
-0
src/vs/editor/browser/standalone/simpleServices.ts
src/vs/editor/browser/standalone/simpleServices.ts
+2
-2
src/vs/platform/keybinding/common/abstractKeybindingService.ts
...s/platform/keybinding/common/abstractKeybindingService.ts
+8
-5
src/vs/platform/keybinding/common/keybindingLabels.ts
src/vs/platform/keybinding/common/keybindingLabels.ts
+9
-19
src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts
.../platform/keybinding/common/usLayoutResolvedKeybinding.ts
+39
-27
src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts
.../keybinding/test/common/abstractKeybindingService.test.ts
+4
-4
src/vs/platform/keybinding/test/common/keybindingLabels.test.ts
.../platform/keybinding/test/common/keybindingLabels.test.ts
+6
-6
src/vs/platform/keybinding/test/common/keybindingResolver.test.ts
...latform/keybinding/test/common/keybindingResolver.test.ts
+14
-9
src/vs/platform/keybinding/test/common/mockKeybindingService.ts
.../platform/keybinding/test/common/mockKeybindingService.ts
+2
-2
src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.ts
...arts/preferences/browser/keybindingsEditorContribution.ts
+2
-2
src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts
...services/keybinding/electron-browser/keybindingService.ts
+37
-25
src/vs/workbench/services/keybinding/test/keybindingIO.test.ts
...s/workbench/services/keybinding/test/keybindingIO.test.ts
+3
-3
src/vs/workbench/services/keybinding/test/keyboardMapper.test.ts
...workbench/services/keybinding/test/keyboardMapper.test.ts
+3
-3
未找到文件。
src/vs/base/common/keyCodes.ts
浏览文件 @
93c52c48
...
...
@@ -6,6 +6,7 @@
'
use strict
'
;
import
{
IHTMLContentElement
}
from
'
vs/base/common/htmlContent
'
;
import
{
OperatingSystem
}
from
'
vs/base/common/platform
'
;
/**
* Virtual Key Codes, the value does not hold any inherent meaning.
...
...
@@ -567,6 +568,67 @@ export class ChordKeybinding {
export
type
Keybinding
=
SimpleKeybinding
|
ChordKeybinding
;
export
function
createRuntimeKeybinding
(
keybinding
:
Keybinding
,
OS
:
OperatingSystem
):
RuntimeKeybinding
{
if
(
keybinding
.
isChord
())
{
return
new
ChordRuntimeKeybinding
(
createSimpleRuntimeKeybinding
(
keybinding
.
extractFirstPart
(),
OS
),
createSimpleRuntimeKeybinding
(
keybinding
.
extractChordPart
(),
OS
),
);
}
return
createSimpleRuntimeKeybinding
(
keybinding
,
OS
);
}
export
function
createSimpleRuntimeKeybinding
(
keybinding
:
SimpleKeybinding
,
OS
:
OperatingSystem
):
SimpleRuntimeKeybinding
{
const
ctrlCmd
=
keybinding
.
hasCtrlCmd
();
const
winCtrl
=
keybinding
.
hasWinCtrl
();
const
ctrlKey
=
(
OS
===
OperatingSystem
.
Macintosh
?
winCtrl
:
ctrlCmd
);
const
metaKey
=
(
OS
===
OperatingSystem
.
Macintosh
?
ctrlCmd
:
winCtrl
);
const
shiftKey
=
keybinding
.
hasShift
();
const
altKey
=
keybinding
.
hasAlt
();
const
keyCode
=
keybinding
.
getKeyCode
();
return
new
SimpleRuntimeKeybinding
(
ctrlKey
,
shiftKey
,
altKey
,
metaKey
,
keyCode
);
}
export
const
enum
RuntimeKeybindingType
{
Simple
=
1
,
Chord
=
2
}
export
class
SimpleRuntimeKeybinding
{
public
readonly
type
=
RuntimeKeybindingType
.
Simple
;
public
readonly
ctrlKey
:
boolean
;
public
readonly
shiftKey
:
boolean
;
public
readonly
altKey
:
boolean
;
public
readonly
metaKey
:
boolean
;
public
readonly
keyCode
:
KeyCode
;
constructor
(
ctrlKey
:
boolean
,
shiftKey
:
boolean
,
altKey
:
boolean
,
metaKey
:
boolean
,
keyCode
:
KeyCode
)
{
this
.
ctrlKey
=
ctrlKey
;
this
.
shiftKey
=
shiftKey
;
this
.
altKey
=
altKey
;
this
.
metaKey
=
metaKey
;
this
.
keyCode
=
keyCode
;
}
}
export
class
ChordRuntimeKeybinding
{
public
readonly
type
=
RuntimeKeybindingType
.
Chord
;
public
readonly
firstPart
:
SimpleRuntimeKeybinding
;
public
readonly
chordPart
:
SimpleRuntimeKeybinding
;
constructor
(
firstPart
:
SimpleRuntimeKeybinding
,
chordPart
:
SimpleRuntimeKeybinding
)
{
this
.
firstPart
=
firstPart
;
this
.
chordPart
=
chordPart
;
}
}
export
type
RuntimeKeybinding
=
SimpleRuntimeKeybinding
|
ChordRuntimeKeybinding
;
/**
* A resolved keybinding.
*/
...
...
src/vs/editor/browser/standalone/simpleServices.ts
浏览文件 @
93c52c48
...
...
@@ -32,7 +32,7 @@ import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRe
import
{
MenuId
,
IMenu
,
IMenuService
}
from
'
vs/platform/actions/common/actions
'
;
import
{
Menu
}
from
'
vs/platform/actions/common/menu
'
;
import
{
ITelemetryService
,
ITelemetryExperiments
,
ITelemetryInfo
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
ResolvedKeybinding
,
Keybinding
,
createKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
ResolvedKeybinding
,
Keybinding
,
createKeybinding
,
createRuntimeKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
ResolvedKeybindingItem
}
from
'
vs/platform/keybinding/common/resolvedKeybindingItem
'
;
import
{
OS
}
from
'
vs/base/common/platform
'
;
...
...
@@ -396,7 +396,7 @@ export class StandaloneKeybindingService extends AbstractKeybindingService {
}
protected
_createResolvedKeybinding
(
kb
:
Keybinding
):
ResolvedKeybinding
{
return
new
USLayoutResolvedKeybinding
(
kb
,
OS
);
return
new
USLayoutResolvedKeybinding
(
createRuntimeKeybinding
(
kb
,
OS
)
,
OS
);
}
}
...
...
src/vs/platform/keybinding/common/abstractKeybindingService.ts
浏览文件 @
93c52c48
...
...
@@ -103,8 +103,10 @@ export abstract class AbstractKeybindingService implements IKeybindingService {
const
contextValue
=
this
.
_contextKeyService
.
getContextValue
(
target
);
const
currentChord
=
this
.
_currentChord
?
this
.
_currentChord
.
keypress
:
null
;
const
keypress
=
keybinding
.
value
.
toString
();
return
this
.
_getResolver
().
resolve
(
contextValue
,
currentChord
,
keypress
);
const
resolvedKeybinding
=
this
.
_createResolvedKeybinding
(
keybinding
);
const
[
firstPart
,]
=
resolvedKeybinding
.
getDispatchParts
();
// We know for a fact the chordPart is null since we're using a single keypress
return
this
.
_getResolver
().
resolve
(
contextValue
,
currentChord
,
firstPart
);
}
protected
_dispatch
(
keybinding
:
SimpleKeybinding
,
target
:
IContextKeyServiceTarget
):
boolean
{
...
...
@@ -117,14 +119,15 @@ export abstract class AbstractKeybindingService implements IKeybindingService {
const
contextValue
=
this
.
_contextKeyService
.
getContextValue
(
target
);
const
currentChord
=
this
.
_currentChord
?
this
.
_currentChord
.
keypress
:
null
;
const
keypress
=
keybinding
.
value
.
toString
();
const
resolvedKeybinding
=
this
.
_createResolvedKeybinding
(
keybinding
);
const
[
firstPart
,]
=
resolvedKeybinding
.
getDispatchParts
();
const
keypressLabel
=
this
.
_createResolvedKeybinding
(
keybinding
).
getLabel
();
const
resolveResult
=
this
.
_getResolver
().
resolve
(
contextValue
,
currentChord
,
keypress
);
const
resolveResult
=
this
.
_getResolver
().
resolve
(
contextValue
,
currentChord
,
firstPart
);
if
(
resolveResult
&&
resolveResult
.
enterChord
)
{
shouldPreventDefault
=
true
;
this
.
_currentChord
=
{
keypress
:
keypress
,
keypress
:
firstPart
,
label
:
keypressLabel
};
if
(
this
.
_statusService
)
{
...
...
src/vs/platform/keybinding/common/keybindingLabels.ts
浏览文件 @
93c52c48
...
...
@@ -8,7 +8,7 @@
import
*
as
nls
from
'
vs/nls
'
;
import
{
OperatingSystem
}
from
'
vs/base/common/platform
'
;
import
{
IHTMLContentElement
}
from
'
vs/base/common/htmlContent
'
;
import
{
Key
binding
,
SimpleKeybinding
,
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
Key
Code
,
RuntimeKeybinding
,
RuntimeKeybindingType
,
SimpleRuntimeKeybinding
}
from
'
vs/base/common/keyCodes
'
;
export
interface
IKeyCodeLabelProvider
{
(
keyCode
:
KeyCode
,
OS
:
OperatingSystem
):
string
;
...
...
@@ -16,28 +16,18 @@ export interface IKeyCodeLabelProvider {
export
class
PrintableKeypress
{
public
static
fromSimpleKeybinding
(
keybinding
:
SimpleKeybinding
,
labelProvider
:
IKeyCodeLabelProvider
,
OS
:
OperatingSystem
):
PrintableKeypress
{
const
ctrlCmd
=
keybinding
.
hasCtrlCmd
();
const
winCtrl
=
keybinding
.
hasWinCtrl
();
const
ctrlKey
=
(
OS
===
OperatingSystem
.
Macintosh
?
winCtrl
:
ctrlCmd
);
const
metaKey
=
(
OS
===
OperatingSystem
.
Macintosh
?
ctrlCmd
:
winCtrl
);
const
shiftKey
=
keybinding
.
hasShift
();
const
altKey
=
keybinding
.
hasAlt
();
const
keyCode
=
keybinding
.
getKeyCode
();
const
keyLabel
=
labelProvider
(
keyCode
,
OS
)
||
''
;
return
new
PrintableKeypress
(
ctrlKey
,
shiftKey
,
altKey
,
metaKey
,
keyLabel
);
private
static
_fromSimpleKeybinding
(
k
:
SimpleRuntimeKeybinding
,
labelProvider
:
IKeyCodeLabelProvider
,
OS
:
OperatingSystem
):
PrintableKeypress
{
const
keyLabel
=
labelProvider
(
k
.
keyCode
,
OS
)
||
''
;
return
new
PrintableKeypress
(
k
.
ctrlKey
,
k
.
shiftKey
,
k
.
altKey
,
k
.
metaKey
,
keyLabel
);
}
public
static
fromKeybinding
(
keybinding
:
Keybinding
,
labelProvider
:
IKeyCodeLabelProvider
,
OS
:
OperatingSystem
):
[
PrintableKeypress
,
PrintableKeypress
]
{
if
(
keybinding
.
isChord
()
)
{
const
firstPart
=
PrintableKeypress
.
fromSimpleKeybinding
(
keybinding
.
extractFirstPart
()
,
labelProvider
,
OS
);
const
chordPart
=
PrintableKeypress
.
fromSimpleKeybinding
(
keybinding
.
extractChordPart
()
,
labelProvider
,
OS
);
public
static
fromKeybinding
(
keybinding
:
Runtime
Keybinding
,
labelProvider
:
IKeyCodeLabelProvider
,
OS
:
OperatingSystem
):
[
PrintableKeypress
,
PrintableKeypress
]
{
if
(
keybinding
.
type
===
RuntimeKeybindingType
.
Chord
)
{
const
firstPart
=
PrintableKeypress
.
_fromSimpleKeybinding
(
keybinding
.
firstPart
,
labelProvider
,
OS
);
const
chordPart
=
PrintableKeypress
.
_fromSimpleKeybinding
(
keybinding
.
chordPart
,
labelProvider
,
OS
);
return
[
firstPart
,
chordPart
];
}
else
{
const
printableKeypress
=
PrintableKeypress
.
fromSimpleKeybinding
(
keybinding
,
labelProvider
,
OS
);
const
printableKeypress
=
PrintableKeypress
.
_
fromSimpleKeybinding
(
keybinding
,
labelProvider
,
OS
);
return
[
printableKeypress
,
null
];
}
}
...
...
src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts
浏览文件 @
93c52c48
...
...
@@ -5,7 +5,7 @@
'
use strict
'
;
import
{
IHTMLContentElement
}
from
'
vs/base/common/htmlContent
'
;
import
{
ResolvedKeybinding
,
Key
binding
,
KeyCode
,
KeyCodeUtils
,
USER_SETTINGS
}
from
'
vs/base/common/keyCodes
'
;
import
{
ResolvedKeybinding
,
Key
Code
,
KeyCodeUtils
,
USER_SETTINGS
,
RuntimeKeybinding
,
RuntimeKeybindingType
,
SimpleRuntimeKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
PrintableKeypress
,
UILabelProvider
,
AriaLabelProvider
,
ElectronAcceleratorLabelProvider
,
UserSettingsLabelProvider
}
from
'
vs/platform/keybinding/common/keybindingLabels
'
;
import
{
OperatingSystem
}
from
'
vs/base/common/platform
'
;
...
...
@@ -14,13 +14,13 @@ import { OperatingSystem } from 'vs/base/common/platform';
*/
export
class
USLayoutResolvedKeybinding
extends
ResolvedKeybinding
{
private
readonly
_actual
:
Keybinding
;
private
readonly
_actual
:
Runtime
Keybinding
;
private
readonly
_os
:
OperatingSystem
;
constructor
(
actual
:
Keybinding
,
os
:
OperatingSystem
)
{
constructor
(
actual
:
RuntimeKeybinding
,
OS
:
OperatingSystem
)
{
super
();
this
.
_actual
=
actual
;
this
.
_os
=
os
;
this
.
_os
=
OS
;
}
private
static
_usKeyCodeToUILabel
(
keyCode
:
KeyCode
,
OS
:
OperatingSystem
):
string
{
...
...
@@ -74,12 +74,12 @@ export class USLayoutResolvedKeybinding extends ResolvedKeybinding {
}
public
getElectronAccelerator
():
string
{
if
(
this
.
_actual
.
isChord
()
)
{
if
(
this
.
_actual
.
type
===
RuntimeKeybindingType
.
Chord
)
{
// Electron cannot handle chords
return
null
;
}
let
keyCode
=
this
.
_actual
.
getKeyCode
()
;
let
keyCode
=
this
.
_actual
.
keyCode
;
if
(
keyCode
>=
KeyCode
.
NUMPAD_0
&&
keyCode
<=
KeyCode
.
NUMPAD_DIVIDE
)
{
// Electron cannot handle numpad keys
return
null
;
...
...
@@ -101,43 +101,35 @@ export class USLayoutResolvedKeybinding extends ResolvedKeybinding {
}
public
isChord
():
boolean
{
return
this
.
_actual
.
isChord
(
);
return
(
this
.
_actual
.
type
===
RuntimeKeybindingType
.
Chord
);
}
public
hasCtrlModifier
():
boolean
{
if
(
this
.
_actual
.
isChord
()
)
{
if
(
this
.
_actual
.
type
===
RuntimeKeybindingType
.
Chord
)
{
return
false
;
}
if
(
this
.
_os
===
OperatingSystem
.
Macintosh
)
{
return
this
.
_actual
.
hasWinCtrl
();
}
else
{
return
this
.
_actual
.
hasCtrlCmd
();
}
return
this
.
_actual
.
ctrlKey
;
}
public
hasShiftModifier
():
boolean
{
if
(
this
.
_actual
.
isChord
()
)
{
if
(
this
.
_actual
.
type
===
RuntimeKeybindingType
.
Chord
)
{
return
false
;
}
return
this
.
_actual
.
hasShift
()
;
return
this
.
_actual
.
shiftKey
;
}
public
hasAltModifier
():
boolean
{
if
(
this
.
_actual
.
isChord
()
)
{
if
(
this
.
_actual
.
type
===
RuntimeKeybindingType
.
Chord
)
{
return
false
;
}
return
this
.
_actual
.
hasAlt
()
;
return
this
.
_actual
.
altKey
;
}
public
hasMetaModifier
():
boolean
{
if
(
this
.
_actual
.
isChord
()
)
{
if
(
this
.
_actual
.
type
===
RuntimeKeybindingType
.
Chord
)
{
return
false
;
}
if
(
this
.
_os
===
OperatingSystem
.
Macintosh
)
{
return
this
.
_actual
.
hasCtrlCmd
();
}
else
{
return
this
.
_actual
.
hasWinCtrl
();
}
return
this
.
_actual
.
metaKey
;
}
public
getDispatchParts
():
[
string
,
string
]
{
...
...
@@ -146,13 +138,33 @@ export class USLayoutResolvedKeybinding extends ResolvedKeybinding {
if
(
this
.
_actual
===
null
)
{
keypressFirstPart
=
null
;
keypressChordPart
=
null
;
}
else
if
(
this
.
_actual
.
isChord
()
)
{
keypressFirstPart
=
this
.
_actual
.
extractFirstPart
().
value
.
toString
(
);
keypressChordPart
=
this
.
_actual
.
extractChordPart
().
value
.
toString
(
);
}
else
if
(
this
.
_actual
.
type
===
RuntimeKeybindingType
.
Chord
)
{
keypressFirstPart
=
USLayoutResolvedKeybinding
.
getDispatchStr
(
this
.
_actual
.
firstPart
);
keypressChordPart
=
USLayoutResolvedKeybinding
.
getDispatchStr
(
this
.
_actual
.
chordPart
);
}
else
{
keypressFirstPart
=
this
.
_actual
.
value
.
toString
(
);
keypressFirstPart
=
USLayoutResolvedKeybinding
.
getDispatchStr
(
this
.
_actual
);
keypressChordPart
=
null
;
}
return
[
keypressFirstPart
,
keypressChordPart
];
}
public
static
getDispatchStr
(
keybinding
:
SimpleRuntimeKeybinding
):
string
{
let
result
=
''
;
if
(
keybinding
.
ctrlKey
)
{
result
+=
'
ctrl+
'
;
}
if
(
keybinding
.
shiftKey
)
{
result
+=
'
shift+
'
;
}
if
(
keybinding
.
altKey
)
{
result
+=
'
alt+
'
;
}
if
(
keybinding
.
metaKey
)
{
result
+=
'
meta+
'
;
}
result
+=
KeyCodeUtils
.
toString
(
keybinding
.
keyCode
);
return
result
;
}
}
src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts
浏览文件 @
93c52c48
...
...
@@ -5,7 +5,7 @@
'
use strict
'
;
import
*
as
assert
from
'
assert
'
;
import
{
ResolvedKeybinding
,
Keybinding
,
SimpleKeybinding
,
createKeybinding
,
KeyCode
,
KeyMod
,
KeyChord
}
from
'
vs/base/common/keyCodes
'
;
import
{
ResolvedKeybinding
,
Keybinding
,
SimpleKeybinding
,
createKeybinding
,
KeyCode
,
KeyMod
,
KeyChord
,
createRuntimeKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
AbstractKeybindingService
}
from
'
vs/platform/keybinding/common/abstractKeybindingService
'
;
import
{
USLayoutResolvedKeybinding
}
from
'
vs/platform/keybinding/common/usLayoutResolvedKeybinding
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
...
...
@@ -40,7 +40,7 @@ suite('AbstractKeybindingService', () => {
}
protected
_createResolvedKeybinding
(
kb
:
Keybinding
):
ResolvedKeybinding
{
return
new
USLayoutResolvedKeybinding
(
kb
,
OS
);
return
new
USLayoutResolvedKeybinding
(
createRuntimeKeybinding
(
kb
,
OS
)
,
OS
);
}
public
dispatch
(
keybinding
:
SimpleKeybinding
):
boolean
{
...
...
@@ -130,7 +130,7 @@ suite('AbstractKeybindingService', () => {
});
function
kbItem
(
keybinding
:
number
,
command
:
string
,
when
:
ContextKeyExpr
=
null
):
ResolvedKeybindingItem
{
const
resolvedKeybinding
=
(
keybinding
!==
0
?
new
USLayoutResolvedKeybinding
(
create
Keybinding
(
keybinding
),
OS
)
:
null
);
const
resolvedKeybinding
=
(
keybinding
!==
0
?
new
USLayoutResolvedKeybinding
(
create
RuntimeKeybinding
(
createKeybinding
(
keybinding
),
OS
),
OS
)
:
null
);
return
new
ResolvedKeybindingItem
(
resolvedKeybinding
,
command
,
...
...
@@ -141,7 +141,7 @@ suite('AbstractKeybindingService', () => {
}
function
toUsLabel
(
keybinding
:
number
):
string
{
const
usResolvedKeybinding
=
new
USLayoutResolvedKeybinding
(
create
Keybinding
(
keybinding
),
OS
);
const
usResolvedKeybinding
=
new
USLayoutResolvedKeybinding
(
create
RuntimeKeybinding
(
createKeybinding
(
keybinding
),
OS
),
OS
);
return
usResolvedKeybinding
.
getLabel
();
}
...
...
src/vs/platform/keybinding/test/common/keybindingLabels.test.ts
浏览文件 @
93c52c48
...
...
@@ -5,7 +5,7 @@
'
use strict
'
;
import
*
as
assert
from
'
assert
'
;
import
{
createKeybinding
,
KeyCode
,
KeyMod
,
KeyChord
}
from
'
vs/base/common/keyCodes
'
;
import
{
createKeybinding
,
KeyCode
,
KeyMod
,
KeyChord
,
createRuntimeKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
IHTMLContentElement
}
from
'
vs/base/common/htmlContent
'
;
import
{
USLayoutResolvedKeybinding
}
from
'
vs/platform/keybinding/common/usLayoutResolvedKeybinding
'
;
import
{
OperatingSystem
}
from
'
vs/base/common/platform
'
;
...
...
@@ -13,7 +13,7 @@ import { OperatingSystem } from 'vs/base/common/platform';
suite
(
'
KeybindingLabels
'
,
()
=>
{
function
assertUSLabel
(
OS
:
OperatingSystem
,
keybinding
:
number
,
expected
:
string
):
void
{
const
usResolvedKeybinding
=
new
USLayoutResolvedKeybinding
(
create
Keybinding
(
keybinding
),
OS
);
const
usResolvedKeybinding
=
new
USLayoutResolvedKeybinding
(
create
RuntimeKeybinding
(
createKeybinding
(
keybinding
),
OS
),
OS
);
assert
.
equal
(
usResolvedKeybinding
.
getLabel
(),
expected
);
}
...
...
@@ -118,7 +118,7 @@ suite('KeybindingLabels', () => {
test
(
'
Aria label
'
,
()
=>
{
function
assertAriaLabel
(
OS
:
OperatingSystem
,
keybinding
:
number
,
expected
:
string
):
void
{
const
usResolvedKeybinding
=
new
USLayoutResolvedKeybinding
(
create
Keybinding
(
keybinding
),
OS
);
const
usResolvedKeybinding
=
new
USLayoutResolvedKeybinding
(
create
RuntimeKeybinding
(
createKeybinding
(
keybinding
),
OS
),
OS
);
assert
.
equal
(
usResolvedKeybinding
.
getAriaLabel
(),
expected
);
}
...
...
@@ -129,7 +129,7 @@ suite('KeybindingLabels', () => {
test
(
'
Electron Accelerator label
'
,
()
=>
{
function
assertElectronAcceleratorLabel
(
OS
:
OperatingSystem
,
keybinding
:
number
,
expected
:
string
):
void
{
const
usResolvedKeybinding
=
new
USLayoutResolvedKeybinding
(
create
Keybinding
(
keybinding
),
OS
);
const
usResolvedKeybinding
=
new
USLayoutResolvedKeybinding
(
create
RuntimeKeybinding
(
createKeybinding
(
keybinding
),
OS
),
OS
);
assert
.
equal
(
usResolvedKeybinding
.
getElectronAccelerator
(),
expected
);
}
...
...
@@ -156,7 +156,7 @@ suite('KeybindingLabels', () => {
test
(
'
User Settings label
'
,
()
=>
{
function
assertElectronAcceleratorLabel
(
OS
:
OperatingSystem
,
keybinding
:
number
,
expected
:
string
):
void
{
const
usResolvedKeybinding
=
new
USLayoutResolvedKeybinding
(
create
Keybinding
(
keybinding
),
OS
);
const
usResolvedKeybinding
=
new
USLayoutResolvedKeybinding
(
create
RuntimeKeybinding
(
createKeybinding
(
keybinding
),
OS
),
OS
);
assert
.
equal
(
usResolvedKeybinding
.
getUserSettingsLabel
(),
expected
);
}
...
...
@@ -172,7 +172,7 @@ suite('KeybindingLabels', () => {
test
(
'
US HTML label
'
,
()
=>
{
function
assertHTMLLabel
(
OS
:
OperatingSystem
,
keybinding
:
number
,
expected
:
IHTMLContentElement
[]):
void
{
const
usResolvedKeybinding
=
new
USLayoutResolvedKeybinding
(
create
Keybinding
(
keybinding
),
OS
);
const
usResolvedKeybinding
=
new
USLayoutResolvedKeybinding
(
create
RuntimeKeybinding
(
createKeybinding
(
keybinding
),
OS
),
OS
);
assert
.
deepEqual
(
usResolvedKeybinding
.
getHTMLLabel
(),
expected
);
}
...
...
src/vs/platform/keybinding/test/common/keybindingResolver.test.ts
浏览文件 @
93c52c48
...
...
@@ -5,7 +5,7 @@
'
use strict
'
;
import
*
as
assert
from
'
assert
'
;
import
{
createKeybinding
,
SimpleKeybinding
,
KeyCode
,
KeyMod
,
KeyChord
}
from
'
vs/base/common/keyCodes
'
;
import
{
createKeybinding
,
SimpleKeybinding
,
KeyCode
,
KeyMod
,
KeyChord
,
createRuntimeKeybinding
,
createSimpleRuntimeKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
KeybindingResolver
}
from
'
vs/platform/keybinding/common/keybindingResolver
'
;
import
{
ContextKeyAndExpr
,
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
ResolvedKeybindingItem
}
from
'
vs/platform/keybinding/common/resolvedKeybindingItem
'
;
...
...
@@ -15,7 +15,7 @@ import { OS } from 'vs/base/common/platform';
suite
(
'
KeybindingResolver
'
,
()
=>
{
function
kbItem
(
keybinding
:
number
,
command
:
string
,
commandArgs
:
any
,
when
:
ContextKeyExpr
,
isDefault
:
boolean
):
ResolvedKeybindingItem
{
const
resolvedKeybinding
=
(
keybinding
!==
0
?
new
USLayoutResolvedKeybinding
(
create
Keybinding
(
keybinding
),
OS
)
:
null
);
const
resolvedKeybinding
=
(
keybinding
!==
0
?
new
USLayoutResolvedKeybinding
(
create
RuntimeKeybinding
(
createKeybinding
(
keybinding
),
OS
),
OS
)
:
null
);
return
new
ResolvedKeybindingItem
(
resolvedKeybinding
,
command
,
...
...
@@ -25,6 +25,11 @@ suite('KeybindingResolver', () => {
);
}
function
getDispatchStr
(
kb
:
SimpleKeybinding
):
string
{
let
runtimeKb
=
createSimpleRuntimeKeybinding
(
kb
,
OS
);
return
USLayoutResolvedKeybinding
.
getDispatchStr
(
runtimeKb
);
}
test
(
'
resolve key
'
,
function
()
{
let
keybinding
=
KeyMod
.
CtrlCmd
|
KeyMod
.
Shift
|
KeyCode
.
KEY_Z
;
let
contextRules
=
ContextKeyExpr
.
equals
(
'
bar
'
,
'
baz
'
);
...
...
@@ -34,8 +39,8 @@ suite('KeybindingResolver', () => {
assert
.
equal
(
KeybindingResolver
.
contextMatchesRules
({
bar
:
'
bz
'
},
contextRules
),
false
);
let
resolver
=
new
KeybindingResolver
([
keybindingItem
],
[]);
assert
.
equal
(
resolver
.
resolve
({
bar
:
'
baz
'
},
null
,
new
SimpleKeybinding
(
keybinding
).
value
.
toString
(
)).
commandId
,
'
yes
'
);
assert
.
equal
(
resolver
.
resolve
({
bar
:
'
bz
'
},
null
,
new
SimpleKeybinding
(
keybinding
).
value
.
toString
(
)),
null
);
assert
.
equal
(
resolver
.
resolve
({
bar
:
'
baz
'
},
null
,
getDispatchStr
(
new
SimpleKeybinding
(
keybinding
)
)).
commandId
,
'
yes
'
);
assert
.
equal
(
resolver
.
resolve
({
bar
:
'
bz
'
},
null
,
getDispatchStr
(
new
SimpleKeybinding
(
keybinding
)
)),
null
);
});
test
(
'
resolve key with arguments
'
,
function
()
{
...
...
@@ -45,7 +50,7 @@ suite('KeybindingResolver', () => {
let
keybindingItem
=
kbItem
(
keybinding
,
'
yes
'
,
commandArgs
,
contextRules
,
true
);
let
resolver
=
new
KeybindingResolver
([
keybindingItem
],
[]);
assert
.
equal
(
resolver
.
resolve
({
bar
:
'
baz
'
},
null
,
new
SimpleKeybinding
(
keybinding
).
value
.
toString
(
)).
commandArgs
,
commandArgs
);
assert
.
equal
(
resolver
.
resolve
({
bar
:
'
baz
'
},
null
,
getDispatchStr
(
new
SimpleKeybinding
(
keybinding
)
)).
commandArgs
,
commandArgs
);
});
test
(
'
KeybindingResolver.combine simple 1
'
,
function
()
{
...
...
@@ -321,7 +326,7 @@ suite('KeybindingResolver', () => {
let
lookupResult
=
resolver
.
lookupKeybindings
(
commandId
);
assert
.
equal
(
lookupResult
.
length
,
expectedKeys
.
length
,
'
Length mismatch @ commandId
'
+
commandId
+
'
; GOT:
'
+
JSON
.
stringify
(
lookupResult
,
null
,
'
\t
'
));
for
(
let
i
=
0
,
len
=
lookupResult
.
length
;
i
<
len
;
i
++
)
{
const
expected
=
new
USLayoutResolvedKeybinding
(
create
Keybinding
(
expectedKeys
[
i
]
),
OS
);
const
expected
=
new
USLayoutResolvedKeybinding
(
create
RuntimeKeybinding
(
createKeybinding
(
expectedKeys
[
i
]),
OS
),
OS
);
assert
.
equal
(
lookupResult
[
i
].
resolvedKeybinding
.
getUserSettingsLabel
(),
expected
.
getUserSettingsLabel
(),
'
value mismatch @ commandId
'
+
commandId
);
}
...
...
@@ -331,8 +336,8 @@ suite('KeybindingResolver', () => {
let
expectedKey
=
createKeybinding
(
_expectedKey
);
if
(
expectedKey
.
isChord
())
{
let
firstPart
=
expectedKey
.
extractFirstPart
().
value
.
toString
(
);
let
chordPart
=
expectedKey
.
extractChordPart
().
value
.
toString
(
);
let
firstPart
=
getDispatchStr
(
expectedKey
.
extractFirstPart
()
);
let
chordPart
=
getDispatchStr
(
expectedKey
.
extractChordPart
()
);
let
result
=
resolver
.
resolve
(
ctx
,
null
,
firstPart
);
assert
.
ok
(
result
!==
null
,
'
Enters chord for
'
+
commandId
);
...
...
@@ -344,7 +349,7 @@ suite('KeybindingResolver', () => {
assert
.
equal
(
result
.
commandId
,
commandId
,
'
Finds chorded command
'
+
commandId
);
assert
.
equal
(
result
.
enterChord
,
false
,
'
Finds chorded command
'
+
commandId
);
}
else
{
let
result
=
resolver
.
resolve
(
ctx
,
null
,
expectedKey
.
value
.
toString
(
));
let
result
=
resolver
.
resolve
(
ctx
,
null
,
getDispatchStr
(
expectedKey
));
assert
.
ok
(
result
!==
null
,
'
Finds command
'
+
commandId
);
assert
.
equal
(
result
.
commandId
,
commandId
,
'
Finds command
'
+
commandId
);
assert
.
equal
(
result
.
enterChord
,
false
,
'
Finds command
'
+
commandId
);
...
...
src/vs/platform/keybinding/test/common/mockKeybindingService.ts
浏览文件 @
93c52c48
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
{
ResolvedKeybinding
,
Keybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
ResolvedKeybinding
,
Keybinding
,
createRuntimeKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
Event
from
'
vs/base/common/event
'
;
import
{
IKeybindingService
,
IKeybindingEvent
,
IKeybindingItem2
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IContextKey
,
IContextKeyService
,
IContextKeyServiceTarget
,
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
...
...
@@ -77,7 +77,7 @@ export class MockKeybindingService2 implements IKeybindingService {
}
public
resolveKeybinding
(
keybinding
:
Keybinding
):
ResolvedKeybinding
{
return
new
USLayoutResolvedKeybinding
(
keybinding
,
OS
);
return
new
USLayoutResolvedKeybinding
(
createRuntimeKeybinding
(
keybinding
,
OS
)
,
OS
);
}
public
lookupKeybindings
(
commandId
:
string
):
ResolvedKeybinding
[]
{
...
...
src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.ts
浏览文件 @
93c52c48
...
...
@@ -9,7 +9,7 @@ import * as nls from 'vs/nls';
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
{
RunOnceScheduler
}
from
'
vs/base/common/async
'
;
import
{
MarkedString
}
from
'
vs/base/common/htmlContent
'
;
import
{
createKeybinding
,
KeyCode
,
KeyMod
,
KeyChord
}
from
'
vs/base/common/keyCodes
'
;
import
{
createKeybinding
,
KeyCode
,
KeyMod
,
KeyChord
,
createRuntimeKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
KeybindingIO
}
from
'
vs/workbench/services/keybinding/common/keybindingIO
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
...
...
@@ -170,7 +170,7 @@ export class DefineKeybindingController implements editorCommon.IEditorContribut
let
keybinding
=
createKeybinding
(
numKeybinding
);
let
resolvedKeybinding
=
this
.
_keybindingService
.
resolveKeybinding
(
keybinding
);
const
usResolvedKeybinding
=
new
USLayoutResolvedKeybinding
(
keybinding
,
OS
);
const
usResolvedKeybinding
=
new
USLayoutResolvedKeybinding
(
createRuntimeKeybinding
(
keybinding
,
OS
)
,
OS
);
return
{
strKeybinding
:
strKeybinding
,
keybinding
:
keybinding
,
...
...
src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts
浏览文件 @
93c52c48
...
...
@@ -7,7 +7,7 @@
import
*
as
nls
from
'
vs/nls
'
;
import
{
IHTMLContentElement
}
from
'
vs/base/common/htmlContent
'
;
import
{
IJSONSchema
}
from
'
vs/base/common/jsonSchema
'
;
import
{
ResolvedKeybinding
,
Keybinding
,
createKeybinding
,
KeyCode
,
USER_SETTINGS
}
from
'
vs/base/common/keyCodes
'
;
import
{
ResolvedKeybinding
,
Keybinding
,
createKeybinding
,
KeyCode
,
USER_SETTINGS
,
RuntimeKeybinding
,
RuntimeKeybindingType
,
SimpleRuntimeKeybinding
,
KeyCodeUtils
,
createRuntimeKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
PrintableKeypress
,
UILabelProvider
,
AriaLabelProvider
,
UserSettingsLabelProvider
}
from
'
vs/platform/keybinding/common/keybindingLabels
'
;
import
{
OS
,
OperatingSystem
}
from
'
vs/base/common/platform
'
;
import
{
toDisposable
}
from
'
vs/base/common/lifecycle
'
;
...
...
@@ -122,9 +122,9 @@ let keybindingsExtPoint = ExtensionsRegistry.registerExtensionPoint<ContributedK
export
class
FancyResolvedKeybinding
extends
ResolvedKeybinding
{
private
readonly
_actual
:
Keybinding
;
private
readonly
_actual
:
Runtime
Keybinding
;
constructor
(
actual
:
Keybinding
)
{
constructor
(
actual
:
Runtime
Keybinding
)
{
super
();
this
.
_actual
=
actual
;
}
...
...
@@ -181,43 +181,35 @@ export class FancyResolvedKeybinding extends ResolvedKeybinding {
}
public
isChord
():
boolean
{
return
this
.
_actual
.
isChord
(
);
return
(
this
.
_actual
.
type
===
RuntimeKeybindingType
.
Chord
);
}
public
hasCtrlModifier
():
boolean
{
if
(
this
.
_actual
.
isChord
()
)
{
if
(
this
.
_actual
.
type
===
RuntimeKeybindingType
.
Chord
)
{
return
false
;
}
if
(
OS
===
OperatingSystem
.
Macintosh
)
{
return
this
.
_actual
.
hasWinCtrl
();
}
else
{
return
this
.
_actual
.
hasCtrlCmd
();
}
return
this
.
_actual
.
ctrlKey
;
}
public
hasShiftModifier
():
boolean
{
if
(
this
.
_actual
.
isChord
()
)
{
if
(
this
.
_actual
.
type
===
RuntimeKeybindingType
.
Chord
)
{
return
false
;
}
return
this
.
_actual
.
hasShift
()
;
return
this
.
_actual
.
shiftKey
;
}
public
hasAltModifier
():
boolean
{
if
(
this
.
_actual
.
isChord
()
)
{
if
(
this
.
_actual
.
type
===
RuntimeKeybindingType
.
Chord
)
{
return
false
;
}
return
this
.
_actual
.
hasAlt
()
;
return
this
.
_actual
.
altKey
;
}
public
hasMetaModifier
():
boolean
{
if
(
this
.
_actual
.
isChord
()
)
{
if
(
this
.
_actual
.
type
===
RuntimeKeybindingType
.
Chord
)
{
return
false
;
}
if
(
OS
===
OperatingSystem
.
Macintosh
)
{
return
this
.
_actual
.
hasCtrlCmd
();
}
else
{
return
this
.
_actual
.
hasWinCtrl
();
}
return
this
.
_actual
.
metaKey
;
}
public
getDispatchParts
():
[
string
,
string
]
{
...
...
@@ -226,15 +218,35 @@ export class FancyResolvedKeybinding extends ResolvedKeybinding {
if
(
this
.
_actual
===
null
)
{
keypressFirstPart
=
null
;
keypressChordPart
=
null
;
}
else
if
(
this
.
_actual
.
isChord
()
)
{
keypressFirstPart
=
this
.
_
actual
.
extractFirstPart
().
value
.
toString
(
);
keypressChordPart
=
this
.
_
actual
.
extractChordPart
().
value
.
toString
(
);
}
else
if
(
this
.
_actual
.
type
===
RuntimeKeybindingType
.
Chord
)
{
keypressFirstPart
=
this
.
_
getDispatchPart
(
this
.
_actual
.
firstPart
);
keypressChordPart
=
this
.
_
getDispatchPart
(
this
.
_actual
.
chordPart
);
}
else
{
keypressFirstPart
=
this
.
_
actual
.
value
.
toString
(
);
keypressFirstPart
=
this
.
_
getDispatchPart
(
this
.
_actual
);
keypressChordPart
=
null
;
}
return
[
keypressFirstPart
,
keypressChordPart
];
}
private
_getDispatchPart
(
keybinding
:
SimpleRuntimeKeybinding
):
string
{
let
result
=
''
;
if
(
keybinding
.
ctrlKey
)
{
result
+=
'
ctrl+
'
;
}
if
(
keybinding
.
shiftKey
)
{
result
+=
'
shift+
'
;
}
if
(
keybinding
.
altKey
)
{
result
+=
'
alt+
'
;
}
if
(
keybinding
.
metaKey
)
{
result
+=
'
meta+
'
;
}
result
+=
KeyCodeUtils
.
toString
(
keybinding
.
keyCode
);
return
result
;
}
}
export
class
WorkbenchKeybindingService
extends
AbstractKeybindingService
{
...
...
@@ -349,7 +361,7 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
}
protected
_createResolvedKeybinding
(
kb
:
Keybinding
):
ResolvedKeybinding
{
return
new
FancyResolvedKeybinding
(
kb
);
return
new
FancyResolvedKeybinding
(
createRuntimeKeybinding
(
kb
,
OS
)
);
}
private
_handleKeybindingsExtensionPointUser
(
isBuiltin
:
boolean
,
keybindings
:
ContributedKeyBinding
|
ContributedKeyBinding
[],
collector
:
ExtensionMessageCollector
):
boolean
{
...
...
src/vs/workbench/services/keybinding/test/keybindingIO.test.ts
浏览文件 @
93c52c48
...
...
@@ -5,7 +5,7 @@
'
use strict
'
;
import
*
as
assert
from
'
assert
'
;
import
{
createKeybinding
,
KeyCode
,
KeyMod
,
KeyChord
,
KeyCodeUtils
}
from
'
vs/base/common/keyCodes
'
;
import
{
createKeybinding
,
KeyCode
,
KeyMod
,
KeyChord
,
KeyCodeUtils
,
createRuntimeKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
KeybindingIO
}
from
'
vs/workbench/services/keybinding/common/keybindingIO
'
;
import
{
OS
,
OperatingSystem
}
from
'
vs/base/common/platform
'
;
import
{
IUserFriendlyKeybinding
}
from
'
vs/platform/keybinding/common/keybinding
'
;
...
...
@@ -31,7 +31,7 @@ suite('keybindingIO', () => {
if
(
ignore
[
keyCode
])
{
continue
;
}
let
usLayoutResolvedKeybinding
=
new
USLayoutResolvedKeybinding
(
create
Keybinding
(
keyCode
),
OS
);
let
usLayoutResolvedKeybinding
=
new
USLayoutResolvedKeybinding
(
create
RuntimeKeybinding
(
createKeybinding
(
keyCode
),
OS
),
OS
);
let
userSettings
=
usLayoutResolvedKeybinding
.
getUserSettingsLabel
();
testIsGood
(
userSettings
,
keyCode
+
'
-
'
+
KeyCodeUtils
.
toString
(
keyCode
)
+
'
-
'
+
userSettings
);
}
...
...
@@ -57,7 +57,7 @@ suite('keybindingIO', () => {
test
(
'
serialize/deserialize
'
,
function
()
{
function
testOneSerialization
(
keybinding
:
number
,
expected
:
string
,
msg
:
string
,
OS
:
OperatingSystem
):
void
{
let
usLayoutResolvedKeybinding
=
new
USLayoutResolvedKeybinding
(
create
Keybinding
(
keybinding
),
OS
);
let
usLayoutResolvedKeybinding
=
new
USLayoutResolvedKeybinding
(
create
RuntimeKeybinding
(
createKeybinding
(
keybinding
),
OS
),
OS
);
let
actualSerialized
=
usLayoutResolvedKeybinding
.
getUserSettingsLabel
();
assert
.
equal
(
actualSerialized
,
expected
,
expected
+
'
-
'
+
msg
);
}
...
...
src/vs/workbench/services/keybinding/test/keyboardMapper.test.ts
浏览文件 @
93c52c48
...
...
@@ -6,7 +6,7 @@
'
use strict
'
;
import
*
as
assert
from
'
assert
'
;
import
{
KeyMod
,
KeyCode
,
SimpleKeybinding
,
createKeybinding
,
Keybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
KeyMod
,
KeyCode
,
SimpleKeybinding
,
createKeybinding
,
Keybinding
,
createRuntimeKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
KeyboardMapper
,
IKeyboardMapping
}
from
'
vs/workbench/services/keybinding/common/keyboardMapper
'
;
import
{
OperatingSystem
}
from
'
vs/base/common/platform
'
;
import
{
UserSettingsLabelProvider
,
PrintableKeypress
}
from
'
vs/platform/keybinding/common/keybindingLabels
'
;
...
...
@@ -179,7 +179,7 @@ function _assertKeybindingTranslation(mapper: KeyboardMapper, OS: OperatingSyste
}
else
{
expected
=
[];
}
let
keybindingLabel
=
new
USLayoutResolvedKeybinding
(
create
Keybinding
(
kb
),
OS
).
getUserSettingsLabel
();
let
keybindingLabel
=
new
USLayoutResolvedKeybinding
(
create
RuntimeKeybinding
(
createKeybinding
(
kb
),
OS
),
OS
).
getUserSettingsLabel
();
let
actualHardwareKeypresses
=
mapper
.
simpleKeybindingToHardwareKeypress
(
new
SimpleKeybinding
(
kb
));
if
(
actualHardwareKeypresses
.
length
===
0
)
{
...
...
@@ -201,7 +201,7 @@ function _assertKeybindingTranslation(mapper: KeyboardMapper, OS: OperatingSyste
return
;
}
const
reversedLabel
=
new
USLayoutResolvedKeybinding
(
reversed
,
OS
).
getUserSettingsLabel
();
const
reversedLabel
=
new
USLayoutResolvedKeybinding
(
createRuntimeKeybinding
(
reversed
,
OS
)
,
OS
).
getUserSettingsLabel
();
assert
.
equal
(
reversedLabel
,
keybindingLabel
,
`
${
keybindingLabel
}
->
${
hardwareKeypressLabel
}
->
${
reversedLabel
}
`
);
});
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录