33 * See 'LICENSE' in the project root for license information.
44 * ------------------------------------------------------------------------------------------ */
55
6- /** @file The functions here are safe to call from a worker thread or the main thread. */
6+ /** @file The functions here are safe to call from a worker thread or the main thread. */
77
88import { ChildProcess , spawn } from 'node:child_process' ;
99import { access , constants , readdir , stat } from 'node:fs/promises' ;
@@ -149,16 +149,12 @@ export interface Disposable {
149149 *
150150 * @example
151151 * item.onDidChange(function(event) { console.log("Event happened: " + event); });
152+ *
153+ * @param listener The listener function will be called when the event happens.
154+ * @param thisArgs The `this`-argument which will be used when calling the event listener.
155+ * @param disposables An array to which a {@link Disposable} will be added.
156+ * @returns A disposable which unsubscribes the event listener.
152157 */
153- /**
154- * A function that represents an event to which you subscribe by calling it with
155- * a listener function as argument.
156- *
157- * @param listener The listener function will be called when the event happens.
158- * @param thisArgs The `this`-argument which will be used when calling the event listener.
159- * @param disposables An array to which a {@link Disposable} will be added.
160- * @returns A disposable which unsubscribes the event listener.
161- */
162158export type Event < T > = ( listener : ( e : T ) => any , thisArgs ?: any , disposables ?: Disposable [ ] ) => Disposable ;
163159
164160/** The key for a localize call.
@@ -296,7 +292,7 @@ interface ProcessOutput {
296292 * @param continueOn Optional string pattern that, when found in stdout, will cause the process to be considered complete before it exits.
297293 * @param skipLogging Optional flag to skip logging process output.
298294 * @param cancellationToken Optional token that can be used to cancel the process.
299- * @returns A promise that resolves to the process output, including stdout, stderr and exit code.
295+ * @returns A promise that resolves to the process output, including stdout, stderr and exit code.
300296 */
301297async function spawnChildProcessImpl ( program : string , args : string [ ] , continueOn ?: string , skipLogging ?: boolean , cancellationToken ?: CancellationToken ) : Promise < ProcessOutput > {
302298 const result = new ManualPromise < ProcessOutput > ( ) ;
@@ -313,7 +309,9 @@ async function spawnChildProcessImpl(program: string, args: string[], continueOn
313309 appendLine ( localize ( 'killing.process' , 'Killing process {0}' , program ) ) ;
314310
315311 proc . kill ( ) ;
316- } ) ; /** Cleans up resources associated with the process.
312+ } ) ;
313+
314+ /** Cleans up resources associated with the process.
317315 * Removes all event listeners and disposes the cancellation token listener.
318316 */
319317 const clean = ( ) => {
0 commit comments