Skip to content

Commit 27a1eff

Browse files
committed
1 parent 40ec20c commit 27a1eff

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

src/vs/platform/keybinding/common/keybindingResolver.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ export class KeybindingResolver {
314314
public static getAllUnboundCommands(boundCommands: Map<string, boolean>): string[] {
315315
const unboundCommands: string[] = [];
316316
const seenMap: Map<string, boolean> = new Map<string, boolean>();
317-
const addCommand = id => {
317+
const addCommand = (id: string, includeCommandWithArgs: boolean) => {
318318
if (seenMap.has(id)) {
319319
return;
320320
}
@@ -325,18 +325,20 @@ export class KeybindingResolver {
325325
if (boundCommands.get(id) === true) {
326326
return;
327327
}
328-
const command = CommandsRegistry.getCommand(id);
329-
if (command && typeof command.description === 'object'
330-
&& isNonEmptyArray((<ICommandHandlerDescription>command.description).args)) { // command with args
331-
return;
328+
if (!includeCommandWithArgs) {
329+
const command = CommandsRegistry.getCommand(id);
330+
if (command && typeof command.description === 'object'
331+
&& isNonEmptyArray((<ICommandHandlerDescription>command.description).args)) { // command with args
332+
return;
333+
}
332334
}
333335
unboundCommands.push(id);
334336
};
335337
for (const id in MenuRegistry.getCommands()) {
336-
addCommand(id);
338+
addCommand(id, true);
337339
}
338340
for (const id in CommandsRegistry.getCommands()) {
339-
addCommand(id);
341+
addCommand(id, false);
340342
}
341343

342344
return unboundCommands;

0 commit comments

Comments
 (0)