Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
596a96ec
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,发现更多精彩内容 >>
未验证
提交
596a96ec
编写于
11月 17, 2020
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add `ResolvedKeybindingItem.isBuiltinExtension`
上级
22b4c45b
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
28 addition
and
17 deletion
+28
-17
src/vs/editor/contrib/codeAction/test/codeActionKeybindingResolver.test.ts
...trib/codeAction/test/codeActionKeybindingResolver.test.ts
+2
-1
src/vs/editor/standalone/browser/simpleServices.ts
src/vs/editor/standalone/browser/simpleServices.ts
+4
-3
src/vs/platform/keybinding/common/keybindingsRegistry.ts
src/vs/platform/keybinding/common/keybindingsRegistry.ts
+6
-2
src/vs/platform/keybinding/common/resolvedKeybindingItem.ts
src/vs/platform/keybinding/common/resolvedKeybindingItem.ts
+3
-1
src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts
.../keybinding/test/common/abstractKeybindingService.test.ts
+2
-1
src/vs/platform/keybinding/test/common/keybindingResolver.test.ts
...latform/keybinding/test/common/keybindingResolver.test.ts
+2
-1
src/vs/workbench/services/keybinding/browser/keybindingService.ts
...orkbench/services/keybinding/browser/keybindingService.ts
+6
-5
src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts
...eybinding/test/electron-browser/keybindingEditing.test.ts
+1
-1
src/vs/workbench/services/preferences/common/keybindingsEditorModel.ts
...nch/services/preferences/common/keybindingsEditorModel.ts
+1
-1
src/vs/workbench/services/preferences/test/common/keybindingsEditorModel.test.ts
...es/preferences/test/common/keybindingsEditorModel.test.ts
+1
-1
未找到文件。
src/vs/editor/contrib/codeAction/test/codeActionKeybindingResolver.test.ts
浏览文件 @
596a96ec
...
...
@@ -90,6 +90,7 @@ function createCodeActionKeybinding(keycode: KeyCode, command: string, commandAr
commandArgs
,
undefined
,
false
,
null
);
null
,
false
);
}
src/vs/editor/standalone/browser/simpleServices.ts
浏览文件 @
596a96ec
...
...
@@ -332,7 +332,8 @@ export class StandaloneKeybindingService extends AbstractKeybindingService {
when
:
when
,
weight1
:
1000
,
weight2
:
0
,
extensionId
:
null
extensionId
:
null
,
isBuiltinExtension
:
false
});
toDispose
.
add
(
toDisposable
(()
=>
{
...
...
@@ -380,11 +381,11 @@ export class StandaloneKeybindingService extends AbstractKeybindingService {
if
(
!
keybinding
)
{
// This might be a removal keybinding item in user settings => accept it
result
[
resultLen
++
]
=
new
ResolvedKeybindingItem
(
undefined
,
item
.
command
,
item
.
commandArgs
,
when
,
isDefault
,
null
);
result
[
resultLen
++
]
=
new
ResolvedKeybindingItem
(
undefined
,
item
.
command
,
item
.
commandArgs
,
when
,
isDefault
,
null
,
false
);
}
else
{
const
resolvedKeybindings
=
this
.
resolveKeybinding
(
keybinding
);
for
(
const
resolvedKeybinding
of
resolvedKeybindings
)
{
result
[
resultLen
++
]
=
new
ResolvedKeybindingItem
(
resolvedKeybinding
,
item
.
command
,
item
.
commandArgs
,
when
,
isDefault
,
null
);
result
[
resultLen
++
]
=
new
ResolvedKeybindingItem
(
resolvedKeybinding
,
item
.
command
,
item
.
commandArgs
,
when
,
isDefault
,
null
,
false
);
}
}
}
...
...
src/vs/platform/keybinding/common/keybindingsRegistry.ts
浏览文件 @
596a96ec
...
...
@@ -17,6 +17,7 @@ export interface IKeybindingItem {
weight1
:
number
;
weight2
:
number
;
extensionId
:
string
|
null
;
isBuiltinExtension
:
boolean
;
}
export
interface
IKeybindings
{
...
...
@@ -53,6 +54,7 @@ export interface IKeybindingRule2 {
weight
:
number
;
when
:
ContextKeyExpression
|
undefined
;
extensionId
?:
string
;
isBuiltinExtension
?:
boolean
;
}
export
const
enum
KeybindingWeight
{
...
...
@@ -164,7 +166,8 @@ class KeybindingsRegistryImpl implements IKeybindingsRegistry {
when
:
rule
.
when
,
weight1
:
rule
.
weight
,
weight2
:
0
,
extensionId
:
rule
.
extensionId
||
null
extensionId
:
rule
.
extensionId
||
null
,
isBuiltinExtension
:
rule
.
isBuiltinExtension
||
false
};
}
}
...
...
@@ -223,7 +226,8 @@ class KeybindingsRegistryImpl implements IKeybindingsRegistry {
when
:
when
,
weight1
:
weight1
,
weight2
:
weight2
,
extensionId
:
null
extensionId
:
null
,
isBuiltinExtension
:
false
});
this
.
_cachedMergedKeybindings
=
null
;
}
...
...
src/vs/platform/keybinding/common/resolvedKeybindingItem.ts
浏览文件 @
596a96ec
...
...
@@ -18,8 +18,9 @@ export class ResolvedKeybindingItem {
public
readonly
when
:
ContextKeyExpression
|
undefined
;
public
readonly
isDefault
:
boolean
;
public
readonly
extensionId
:
string
|
null
;
public
readonly
isBuiltinExtension
:
boolean
;
constructor
(
resolvedKeybinding
:
ResolvedKeybinding
|
undefined
,
command
:
string
|
null
,
commandArgs
:
any
,
when
:
ContextKeyExpression
|
undefined
,
isDefault
:
boolean
,
extensionId
:
string
|
null
)
{
constructor
(
resolvedKeybinding
:
ResolvedKeybinding
|
undefined
,
command
:
string
|
null
,
commandArgs
:
any
,
when
:
ContextKeyExpression
|
undefined
,
isDefault
:
boolean
,
extensionId
:
string
|
null
,
isBuiltinExtension
:
boolean
)
{
this
.
resolvedKeybinding
=
resolvedKeybinding
;
this
.
keypressParts
=
resolvedKeybinding
?
removeElementsAfterNulls
(
resolvedKeybinding
.
getDispatchParts
())
:
[];
this
.
bubble
=
(
command
?
command
.
charCodeAt
(
0
)
===
CharCode
.
Caret
:
false
);
...
...
@@ -28,6 +29,7 @@ export class ResolvedKeybindingItem {
this
.
when
=
when
;
this
.
isDefault
=
isDefault
;
this
.
extensionId
=
extensionId
;
this
.
isBuiltinExtension
=
isBuiltinExtension
;
}
}
...
...
src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts
浏览文件 @
596a96ec
...
...
@@ -192,7 +192,8 @@ suite('AbstractKeybindingService', () => {
null
,
when
,
true
,
null
null
,
false
);
}
...
...
src/vs/platform/keybinding/test/common/keybindingResolver.test.ts
浏览文件 @
596a96ec
...
...
@@ -28,7 +28,8 @@ suite('KeybindingResolver', () => {
commandArgs
,
when
,
isDefault
,
null
null
,
false
);
}
...
...
src/vs/workbench/services/keybinding/browser/keybindingService.ts
浏览文件 @
596a96ec
...
...
@@ -372,7 +372,7 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
const
keybinding
=
item
.
keybinding
;
if
(
!
keybinding
)
{
// This might be a removal keybinding item in user settings => accept it
result
[
resultLen
++
]
=
new
ResolvedKeybindingItem
(
undefined
,
item
.
command
,
item
.
commandArgs
,
when
,
isDefault
,
item
.
extensionId
);
result
[
resultLen
++
]
=
new
ResolvedKeybindingItem
(
undefined
,
item
.
command
,
item
.
commandArgs
,
when
,
isDefault
,
item
.
extensionId
,
item
.
isBuiltinExtension
);
}
else
{
if
(
this
.
_assertBrowserConflicts
(
keybinding
,
item
.
command
))
{
continue
;
...
...
@@ -381,7 +381,7 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
const
resolvedKeybindings
=
this
.
resolveKeybinding
(
keybinding
);
for
(
let
i
=
resolvedKeybindings
.
length
-
1
;
i
>=
0
;
i
--
)
{
const
resolvedKeybinding
=
resolvedKeybindings
[
i
];
result
[
resultLen
++
]
=
new
ResolvedKeybindingItem
(
resolvedKeybinding
,
item
.
command
,
item
.
commandArgs
,
when
,
isDefault
,
item
.
extensionId
);
result
[
resultLen
++
]
=
new
ResolvedKeybindingItem
(
resolvedKeybinding
,
item
.
command
,
item
.
commandArgs
,
when
,
isDefault
,
item
.
extensionId
,
item
.
isBuiltinExtension
);
}
}
}
...
...
@@ -396,11 +396,11 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
const
parts
=
item
.
parts
;
if
(
parts
.
length
===
0
)
{
// This might be a removal keybinding item in user settings => accept it
result
[
resultLen
++
]
=
new
ResolvedKeybindingItem
(
undefined
,
item
.
command
,
item
.
commandArgs
,
when
,
isDefault
,
null
);
result
[
resultLen
++
]
=
new
ResolvedKeybindingItem
(
undefined
,
item
.
command
,
item
.
commandArgs
,
when
,
isDefault
,
null
,
false
);
}
else
{
const
resolvedKeybindings
=
this
.
_keyboardMapper
.
resolveUserBinding
(
parts
);
for
(
const
resolvedKeybinding
of
resolvedKeybindings
)
{
result
[
resultLen
++
]
=
new
ResolvedKeybindingItem
(
resolvedKeybinding
,
item
.
command
,
item
.
commandArgs
,
when
,
isDefault
,
null
);
result
[
resultLen
++
]
=
new
ResolvedKeybindingItem
(
resolvedKeybinding
,
item
.
command
,
item
.
commandArgs
,
when
,
isDefault
,
null
,
false
);
}
}
}
...
...
@@ -551,7 +551,8 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
mac
:
mac
?
{
primary
:
KeybindingParser
.
parseKeybinding
(
mac
,
OS
)
}
:
null
,
linux
:
linux
?
{
primary
:
KeybindingParser
.
parseKeybinding
(
linux
,
OS
)
}
:
null
,
win
:
win
?
{
primary
:
KeybindingParser
.
parseKeybinding
(
win
,
OS
)
}
:
null
,
extensionId
:
extensionId
.
value
extensionId
:
extensionId
.
value
,
isBuiltinExtension
:
isBuiltin
};
if
(
!
desc
.
primary
&&
!
desc
.
mac
&&
!
desc
.
linux
&&
!
desc
.
win
)
{
...
...
src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts
浏览文件 @
596a96ec
...
...
@@ -324,7 +324,7 @@ suite('KeybindingsEditing', () => {
}
}
const
keybinding
=
parts
.
length
>
0
?
new
USLayoutResolvedKeybinding
(
new
ChordKeybinding
(
parts
),
OS
)
:
undefined
;
return
new
ResolvedKeybindingItem
(
keybinding
,
command
||
'
some command
'
,
null
,
when
?
ContextKeyExpr
.
deserialize
(
when
)
:
undefined
,
isDefault
===
undefined
?
true
:
isDefault
,
null
);
return
new
ResolvedKeybindingItem
(
keybinding
,
command
||
'
some command
'
,
null
,
when
?
ContextKeyExpr
.
deserialize
(
when
)
:
undefined
,
isDefault
===
undefined
?
true
:
isDefault
,
null
,
false
);
}
});
src/vs/workbench/services/preferences/common/keybindingsEditorModel.ts
浏览文件 @
596a96ec
...
...
@@ -187,7 +187,7 @@ export class KeybindingsEditorModel extends EditorModel {
const
commandsWithDefaultKeybindings
=
this
.
keybindingsService
.
getDefaultKeybindings
().
map
(
keybinding
=>
keybinding
.
command
);
for
(
const
command
of
KeybindingResolver
.
getAllUnboundCommands
(
boundCommands
))
{
const
keybindingItem
=
new
ResolvedKeybindingItem
(
undefined
,
command
,
null
,
undefined
,
commandsWithDefaultKeybindings
.
indexOf
(
command
)
===
-
1
,
null
);
const
keybindingItem
=
new
ResolvedKeybindingItem
(
undefined
,
command
,
null
,
undefined
,
commandsWithDefaultKeybindings
.
indexOf
(
command
)
===
-
1
,
null
,
false
);
this
.
_keybindingItemsSortedByPrecedence
.
push
(
KeybindingsEditorModel
.
toKeybindingEntry
(
command
,
keybindingItem
,
workbenchActionsRegistry
,
actionLabels
));
}
this
.
_keybindingItems
=
this
.
_keybindingItemsSortedByPrecedence
.
slice
(
0
).
sort
((
a
,
b
)
=>
KeybindingsEditorModel
.
compareKeybindingData
(
a
,
b
));
...
...
src/vs/workbench/services/preferences/test/common/keybindingsEditorModel.test.ts
浏览文件 @
596a96ec
...
...
@@ -705,7 +705,7 @@ suite('KeybindingsEditorModel', () => {
}
}
const
keybinding
=
parts
.
length
>
0
?
new
USLayoutResolvedKeybinding
(
new
ChordKeybinding
(
parts
),
OS
)
:
undefined
;
return
new
ResolvedKeybindingItem
(
keybinding
,
command
||
'
some command
'
,
null
,
when
?
ContextKeyExpr
.
deserialize
(
when
)
:
undefined
,
isDefault
===
undefined
?
true
:
isDefault
,
null
);
return
new
ResolvedKeybindingItem
(
keybinding
,
command
||
'
some command
'
,
null
,
when
?
ContextKeyExpr
.
deserialize
(
when
)
:
undefined
,
isDefault
===
undefined
?
true
:
isDefault
,
null
,
false
);
}
function
asResolvedKeybindingItems
(
keybindingEntries
:
IKeybindingItemEntry
[],
keepUnassigned
:
boolean
=
false
):
ResolvedKeybindingItem
[]
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录