| 479 | * @returns returned object is considered types T and vscode.Disposable |
| 480 | */ |
| 481 | export 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 | |
| 488 | export type DisposableProcess = cp.ChildProcessWithoutNullStreams & vscode.Disposable; |
| 489 | export function spawn(command: string, args?: ReadonlyArray<string>, options?: cp.CommonOptions, onDisposed?: () => unknown): DisposableProcess { |