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

Method then

Extension/src/Utility/Async/lazy.ts:14–16  ·  view source on GitHub ↗
(onfulfilled?: (value: T) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>)

Source from the content-addressed store, hash-verified

12 }
13
14 override then<TResult1 = T, TResult2 = never>(onfulfilled?: (value: T) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2> {
15 return (this.#promise ??= Promise.resolve(typeof this.initializer === 'function' ? is.Constructor(this.initializer) ? new this.initializer() : (this.initializer as () => T | Promise<T>)() : this.initializer)).then(onfulfilled, onrejected);
16 }
17 override catch(onrejected?: (reason: any) => never): Promise<T> {
18 return (this.#promise ??= Promise.resolve(typeof this.initializer === 'function' ? is.Constructor(this.initializer) ? new this.initializer() : (this.initializer as () => T | Promise<T>)() : this.initializer)).catch(onrejected);
19 }

Callers 15

signals.test.tsFile · 0.45
constructorMethod · 0.45
runFunction · 0.45
checkVsixCompatibilityFunction · 0.45
logDebuggerEventFunction · 0.45
logLanguageServerEventFunction · 0.45
logCopilotEventFunction · 0.45
parentMethod · 0.45
scanMethod · 0.45
resultsMethod · 0.45
getOrAddFunction · 0.45

Calls 2

ConstructorMethod · 0.80
resolveMethod · 0.65

Tested by

no test coverage detected