MCPcopy
hub / github.com/VSCodeVim/Vim / registerCommand

Function registerCommand

extensionBase.ts:559–573  ·  view source on GitHub ↗
(
  context: vscode.ExtensionContext,
  command: string,
  callback: (...args: any[]) => any,
  requiresActiveEditor: boolean = true,
)

Source from the content-addressed store, hash-verified

557}
558
559export function registerCommand(
560 context: vscode.ExtensionContext,
561 command: string,
562 callback: (...args: any[]) => any,
563 requiresActiveEditor: boolean = true,
564) {
565 const disposable = vscode.commands.registerCommand(command, async (args) => {
566 if (requiresActiveEditor && !vscode.window.activeTextEditor) {
567 return;
568 }
569
570 callback(args);
571 });
572 context.subscriptions.push(disposable);
573}
574
575export function registerEventListener<T>(
576 context: vscode.ExtensionContext,

Callers 2

activateFunction · 0.90
activateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected