MCPcopy Create free account
hub / github.com/Wscats/vscode-explore / handleCommand

Function handleCommand

contributes/src/register.ts:20–37  ·  view source on GitHub ↗
(userFriendlyCommand: schema.IUserFriendlyCommand, extension: IExtensionPointUser<any>, bucket: schema.IToolbarRegistrations[])

Source from the content-addressed store, hash-verified

18}).setHandler((extensions: readonly IExtensionPointUser<schema.IUserFriendlyCommand | schema.IUserFriendlyCommand[]>[]) => {
19 console.log('-----------ToolbarsContribution------------');
20 function handleCommand(userFriendlyCommand: schema.IUserFriendlyCommand, extension: IExtensionPointUser<any>, bucket: schema.IToolbarRegistrations[]) {
21 if (!schema.isValidCommand(userFriendlyCommand, extension.collector)) {
22 return;
23 }
24 const { when, alt, group, command, component } = userFriendlyCommand;
25
26 if (MenuRegistry.getCommand(command)) {
27 extension.collector.info(localize('dup', "Command `{0}` appears multiple times in the `commands` section.", userFriendlyCommand.command));
28 }
29 bucket.push({
30 id: command,
31 command,
32 alt,
33 group,
34 component,
35 when: ContextKeyExpr.deserialize(when),
36 });
37 }
38
39 _commandRegistrations.clear();
40

Callers 1

register.tsFile · 0.85

Calls 4

localizeFunction · 0.90
infoMethod · 0.80
getCommandMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected