MCPcopy Create free account
hub / github.com/microsoft/vscode-cpptools / notify

Function notify

Extension/src/Utility/Eventing/dispatcher.ts:467–480  ·  view source on GitHub ↗
(name: string, ...variableArgs: any[])

Source from the content-addressed store, hash-verified

465export function notify(name: string, data: ArbitraryObject): void;
466export function notify(name: string): void;
467export function notify(name: string, ...variableArgs: any[]): void {
468 // quickly check if there are any possible handlers for this event
469 if (isSubscribed(name)) {
470 const descriptors = variableArgs[0] instanceof Descriptors ? variableArgs.shift() : Descriptors.none;
471
472 // add the event to the queue
473 queue.push(expandVariableArgs(variableArgs, { name, variableArgs, descriptors }));
474
475 // if the queue was empty, start it draining the queue
476 if (DispatcherBusy.isCompleted) {
477 void drain(); // don't wait for the queue to finish draining
478 }
479 }
480}
481
482/** immediately dispatches an event */
483export function notifyNow(name: string, descriptors: Descriptors, text: string): void;

Callers 3

eventing.test.tsFile · 0.90
notifyFunction · 0.90
newNotificationFunction · 0.90

Calls 4

isSubscribedFunction · 0.85
expandVariableArgsFunction · 0.85
drainFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected