MCPcopy Index your code
hub / github.com/microsoft/vscode-cpptools / spawnChildProcess

Function spawnChildProcess

Extension/src/common.ts:772–791  ·  view source on GitHub ↗
(program: string, args: string[] = [], continueOn?: string, skipLogging?: boolean, cancellationToken?: vscode.CancellationToken)

Source from the content-addressed store, hash-verified

770}
771
772export async function spawnChildProcess(program: string, args: string[] = [], continueOn?: string, skipLogging?: boolean, cancellationToken?: vscode.CancellationToken): Promise<ProcessReturnType> {
773 // Do not use CppSettings to avoid circular require()
774 if (skipLogging === undefined || !skipLogging) {
775 getOutputChannelLogger().appendLineAtLevel(5, `$ ${program} ${args.join(' ')}`);
776 }
777 const programOutput: ProcessOutput = await spawnChildProcessImpl(program, args, continueOn, skipLogging, cancellationToken);
778 const exitCode: number | NodeJS.Signals | undefined = programOutput.exitCode;
779 if (programOutput.exitCode) {
780 return { succeeded: false, exitCode, outputError: programOutput.stderr, output: programOutput.stderr || programOutput.stdout || localize('process.exited', 'Process exited with code {0}', exitCode) };
781 } else {
782 let stdout: string;
783 if (programOutput.stdout.length) {
784 // Type system doesn't work very well here, so we need call toString
785 stdout = programOutput.stdout;
786 } else {
787 stdout = localize('process.succeeded', 'Process executed successfully.');
788 }
789 return { succeeded: true, exitCode, outputError: programOutput.stderr, output: stdout };
790 }
791}
792
793interface ProcessOutput {
794 exitCode?: number | NodeJS.Signals;

Callers

nothing calls this directly

Calls 3

getOutputChannelLoggerFunction · 0.90
spawnChildProcessImplFunction · 0.85
appendLineAtLevelMethod · 0.80

Tested by

no test coverage detected