提交 99217cbf 编写于 作者: A Alex Dima

Fixes #37679: Make `key` optional

上级 6d75a741
......@@ -176,8 +176,8 @@ function isValidContributedKeyBinding(keyBinding: ContributedKeyBinding, rejects
rejects.push(nls.localize('requirestring', "property `{0}` is mandatory and must be of type `string`", 'command'));
return false;
}
if (typeof keyBinding.key !== 'string') {
rejects.push(nls.localize('requirestring', "property `{0}` is mandatory and must be of type `string`", 'key'));
if (keyBinding.key && typeof keyBinding.key !== 'string') {
rejects.push(nls.localize('optstring', "property `{0}` can be omitted or must be of type `string`", 'key'));
return false;
}
if (keyBinding.when && typeof keyBinding.when !== 'string') {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册