提交 27a1eff1 编写于 作者: S Sandeep Somavarapu

Fix #70230

上级 40ec20c3
...@@ -314,7 +314,7 @@ export class KeybindingResolver { ...@@ -314,7 +314,7 @@ export class KeybindingResolver {
public static getAllUnboundCommands(boundCommands: Map<string, boolean>): string[] { public static getAllUnboundCommands(boundCommands: Map<string, boolean>): string[] {
const unboundCommands: string[] = []; const unboundCommands: string[] = [];
const seenMap: Map<string, boolean> = new Map<string, boolean>(); const seenMap: Map<string, boolean> = new Map<string, boolean>();
const addCommand = id => { const addCommand = (id: string, includeCommandWithArgs: boolean) => {
if (seenMap.has(id)) { if (seenMap.has(id)) {
return; return;
} }
...@@ -325,18 +325,20 @@ export class KeybindingResolver { ...@@ -325,18 +325,20 @@ export class KeybindingResolver {
if (boundCommands.get(id) === true) { if (boundCommands.get(id) === true) {
return; return;
} }
const command = CommandsRegistry.getCommand(id); if (!includeCommandWithArgs) {
if (command && typeof command.description === 'object' const command = CommandsRegistry.getCommand(id);
&& isNonEmptyArray((<ICommandHandlerDescription>command.description).args)) { // command with args if (command && typeof command.description === 'object'
return; && isNonEmptyArray((<ICommandHandlerDescription>command.description).args)) { // command with args
return;
}
} }
unboundCommands.push(id); unboundCommands.push(id);
}; };
for (const id in MenuRegistry.getCommands()) { for (const id in MenuRegistry.getCommands()) {
addCommand(id); addCommand(id, true);
} }
for (const id in CommandsRegistry.getCommands()) { for (const id in CommandsRegistry.getCommands()) {
addCommand(id); addCommand(id, false);
} }
return unboundCommands; return unboundCommands;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册