Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
d5df66ae
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,发现更多精彩内容 >>
提交
d5df66ae
编写于
1月 18, 2019
作者:
Y
Yusuke Tsutsumi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixing strict-null-checks
上级
1521cc31
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
19 addition
and
13 deletion
+19
-13
src/vs/base/common/keyCodes.ts
src/vs/base/common/keyCodes.ts
+4
-1
src/vs/base/parts/tree/browser/treeDefaults.ts
src/vs/base/parts/tree/browser/treeDefaults.ts
+6
-4
src/vs/platform/keybinding/test/common/keybindingResolver.test.ts
...latform/keybinding/test/common/keybindingResolver.test.ts
+7
-6
src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts
...ench/services/keybinding/common/macLinuxKeyboardMapper.ts
+1
-1
src/vs/workbench/services/preferences/test/common/keybindingsEditorModel.test.ts
...es/preferences/test/common/keybindingsEditorModel.test.ts
+1
-1
未找到文件。
src/vs/base/common/keyCodes.ts
浏览文件 @
d5df66ae
...
@@ -517,7 +517,10 @@ export class ChordKeybinding {
...
@@ -517,7 +517,10 @@ export class ChordKeybinding {
return
hashCodes
.
join
(
'
;
'
);
return
hashCodes
.
join
(
'
;
'
);
}
}
public
equals
(
other
:
ChordKeybinding
):
boolean
{
public
equals
(
other
:
ChordKeybinding
|
null
):
boolean
{
if
(
other
===
null
)
{
return
false
;
}
if
(
this
.
parts
.
length
!==
other
.
parts
.
length
)
{
if
(
this
.
parts
.
length
!==
other
.
parts
.
length
)
{
return
false
;
return
false
;
}
}
...
...
src/vs/base/parts/tree/browser/treeDefaults.ts
浏览文件 @
d5df66ae
...
@@ -49,7 +49,7 @@ export interface IControllerOptions {
...
@@ -49,7 +49,7 @@ export interface IControllerOptions {
}
}
interface
IKeybindingDispatcherItem
{
interface
IKeybindingDispatcherItem
{
keybinding
:
Keybinding
;
keybinding
:
Keybinding
|
null
;
callback
:
IKeyBindingCallback
;
callback
:
IKeyBindingCallback
;
}
}
...
@@ -63,9 +63,11 @@ export class KeybindingDispatcher {
...
@@ -63,9 +63,11 @@ export class KeybindingDispatcher {
public
has
(
keybinding
:
KeyCode
):
boolean
{
public
has
(
keybinding
:
KeyCode
):
boolean
{
let
target
=
createKeybinding
(
keybinding
,
platform
.
OS
);
let
target
=
createKeybinding
(
keybinding
,
platform
.
OS
);
for
(
const
a
of
this
.
_arr
)
{
if
(
target
!==
null
)
{
if
(
target
.
equals
(
a
.
keybinding
))
{
for
(
const
a
of
this
.
_arr
)
{
return
true
;
if
(
target
.
equals
(
a
.
keybinding
))
{
return
true
;
}
}
}
}
}
return
false
;
return
false
;
...
...
src/vs/platform/keybinding/test/common/keybindingResolver.test.ts
浏览文件 @
d5df66ae
...
@@ -346,21 +346,22 @@ suite('KeybindingResolver', () => {
...
@@ -346,21 +346,22 @@ suite('KeybindingResolver', () => {
let
testResolve
=
(
ctx
:
IContext
,
_expectedKey
:
number
,
commandId
:
string
)
=>
{
let
testResolve
=
(
ctx
:
IContext
,
_expectedKey
:
number
,
commandId
:
string
)
=>
{
const
expectedKey
=
createKeybinding
(
_expectedKey
,
OS
)
!
;
const
expectedKey
=
createKeybinding
(
_expectedKey
,
OS
)
!
;
let
previousPart
=
null
;
let
previousPart
:
(
string
|
null
)
=
null
;
for
(
let
i
=
0
,
len
=
expectedKey
.
parts
.
length
;
i
<
len
;
i
++
)
{
for
(
let
i
=
0
,
len
=
expectedKey
.
parts
.
length
;
i
<
len
;
i
++
)
{
let
part
=
getDispatchStr
(
expectedKey
.
parts
[
i
]);
let
part
=
getDispatchStr
(
expectedKey
.
parts
[
i
]);
let
result
=
resolver
.
resolve
(
ctx
,
previousPart
,
part
);
let
result
=
resolver
.
resolve
(
ctx
,
previousPart
,
part
);
assert
.
ok
(
result
!==
null
,
`Enters chord for
${
commandId
}
at part
${
i
}
`
);
if
(
i
===
len
-
1
)
{
if
(
i
===
len
-
1
)
{
// if it's the final part, then we should find a valid command,
// if it's the final part, then we should find a valid command,
// and there should not be a chord.
// and there should not be a chord.
assert
.
equal
(
result
.
commandId
,
commandId
,
`Enters chord for
${
commandId
}
at part
${
i
}
`
);
assert
.
ok
(
result
!==
null
,
`Enters chord for
${
commandId
}
at part
${
i
}
`
);
assert
.
equal
(
result
.
enterChord
,
false
,
`Enters chord for
${
commandId
}
at part
${
i
}
`
);
assert
.
equal
(
result
!
.
commandId
,
commandId
,
`Enters chord for
${
commandId
}
at part
${
i
}
`
);
assert
.
equal
(
result
!
.
enterChord
,
false
,
`Enters chord for
${
commandId
}
at part
${
i
}
`
);
}
else
{
}
else
{
// if it's not the final part, then we should not find a valid command,
// if it's not the final part, then we should not find a valid command,
// and there should be a chord.
// and there should be a chord.
assert
.
equal
(
result
.
commandId
,
null
,
`Enters chord for
${
commandId
}
at part
${
i
}
`
);
assert
.
ok
(
result
!==
null
,
`Enters chord for
${
commandId
}
at part
${
i
}
`
);
assert
.
equal
(
result
.
enterChord
,
true
,
`Enters chord for
${
commandId
}
at part
${
i
}
`
);
assert
.
equal
(
result
!
.
commandId
,
null
,
`Enters chord for
${
commandId
}
at part
${
i
}
`
);
assert
.
equal
(
result
!
.
enterChord
,
true
,
`Enters chord for
${
commandId
}
at part
${
i
}
`
);
}
}
previousPart
=
part
;
previousPart
=
part
;
}
}
...
...
src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts
浏览文件 @
d5df66ae
...
@@ -171,7 +171,7 @@ export class NativeResolvedKeybinding extends ResolvedKeybinding {
...
@@ -171,7 +171,7 @@ export class NativeResolvedKeybinding extends ResolvedKeybinding {
}
}
public
getDispatchParts
():
(
string
|
null
)[]
{
public
getDispatchParts
():
(
string
|
null
)[]
{
let
dispatchParts
=
[];
let
dispatchParts
:
(
string
|
null
)[]
=
[];
for
(
let
part
of
this
.
_parts
)
{
for
(
let
part
of
this
.
_parts
)
{
dispatchParts
.
push
(
part
?
this
.
_mapper
.
getDispatchStrForScanCodeBinding
(
part
)
:
null
);
dispatchParts
.
push
(
part
?
this
.
_mapper
.
getDispatchStrForScanCodeBinding
(
part
)
:
null
);
}
}
...
...
src/vs/workbench/services/preferences/test/common/keybindingsEditorModel.test.ts
浏览文件 @
d5df66ae
...
@@ -610,7 +610,7 @@ suite('KeybindingsEditorModel test', () => {
...
@@ -610,7 +610,7 @@ suite('KeybindingsEditorModel test', () => {
const
{
ctrlKey
,
shiftKey
,
altKey
,
metaKey
}
=
part
.
modifiers
||
{
ctrlKey
:
false
,
shiftKey
:
false
,
altKey
:
false
,
metaKey
:
false
};
const
{
ctrlKey
,
shiftKey
,
altKey
,
metaKey
}
=
part
.
modifiers
||
{
ctrlKey
:
false
,
shiftKey
:
false
,
altKey
:
false
,
metaKey
:
false
};
return
new
SimpleKeybinding
(
ctrlKey
!
,
shiftKey
!
,
altKey
!
,
metaKey
!
,
part
.
keyCode
);
return
new
SimpleKeybinding
(
ctrlKey
!
,
shiftKey
!
,
altKey
!
,
metaKey
!
,
part
.
keyCode
);
};
};
let
parts
=
[];
let
parts
:
SimpleKeybinding
[]
=
[];
if
(
firstPart
)
{
if
(
firstPart
)
{
parts
.
push
(
aSimpleKeybinding
(
firstPart
));
parts
.
push
(
aSimpleKeybinding
(
firstPart
));
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录