MCPcopy Create free account
hub / github.com/REditorSupport/vscode-R / asDisposable

Function asDisposable

src/util.ts:481–486  ·  view source on GitHub ↗
(toDispose: T, disposeFunction: (...args: unknown[]) => unknown)

Source from the content-addressed store, hash-verified

479 * @returns returned object is considered types T and vscode.Disposable
480 */
481export function asDisposable<T>(toDispose: T, disposeFunction: (...args: unknown[]) => unknown): T & vscode.Disposable {
482 type disposeType = T & vscode.Disposable;
483 (toDispose as disposeType).dispose = () => disposeFunction();
484 extensionContext.subscriptions.push(toDispose as disposeType);
485 return toDispose as disposeType;
486}
487
488export type DisposableProcess = cp.ChildProcessWithoutNullStreams & vscode.Disposable;
489export function spawn(command: string, args?: ReadonlyArray<string>, options?: cp.CommonOptions, onDisposed?: () => unknown): DisposableProcess {

Callers 1

spawnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected