Skip to content

Commit b8d9b71

Browse files
Do not return "parse" if there is not specific output.
1 parent e868f5d commit b8d9b71

File tree

4 files changed

+13
-40
lines changed

4 files changed

+13
-40
lines changed

src/client/common/process/internal.ts

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -275,56 +275,35 @@ export namespace scripts {
275275
//============================
276276
// shell_exec.py
277277

278-
export function shell_exec(
279-
command: string,
280-
lockfile: string,
281-
shellArgs: string[]
282-
): [string[], (out: string) => string] {
278+
export function shell_exec(command: string, lockfile: string, shellArgs: string[]): string[] {
283279
const script = path.join(SCRIPTS_DIR, 'shell_exec.py');
284-
const args = [
280+
// We don't bother with a "parse" function since the output
281+
// could be anything.
282+
return [
285283
script,
286284
command.fileToCommandArgument(),
287285
// The shell args must come after the command
288286
// but before the lockfile.
289287
...shellArgs,
290288
lockfile.fileToCommandArgument()
291289
];
292-
293-
function parse(out: string): string {
294-
// The output is ignored.
295-
return out;
296-
}
297-
298-
return [args, parse];
299290
}
300291

301292
//============================
302293
// testlauncher.py
303294

304-
export function testlauncher(testArgs: string[]): [string[], (out: string) => string] {
295+
export function testlauncher(testArgs: string[]): string[] {
305296
const script = path.join(SCRIPTS_DIR, 'testlauncher.py');
306-
const args = [script, ...testArgs];
307-
308-
function parse(out: string): string {
309-
// We don't worry about the output.
310-
return out;
311-
}
312-
313-
return [args, parse];
297+
// There is no output to parse, so we do not return a function.
298+
return [script, ...testArgs];
314299
}
315300

316301
//============================
317302
// visualstudio_py_testlauncher.py
318303

319-
export function visualstudio_py_testlauncher(testArgs: string[]): [string[], (out: string) => string] {
304+
export function visualstudio_py_testlauncher(testArgs: string[]): string[] {
320305
const script = path.join(SCRIPTS_DIR, 'visualstudio_py_testlauncher.py');
321-
const args = [script, ...testArgs];
322-
323-
function parse(out: string): string {
324-
// We don't worry about the output.
325-
return out;
326-
}
327-
328-
return [args, parse];
306+
// There is no output to parse, so we do not return a function.
307+
return [script, ...testArgs];
329308
}
330309
}

src/client/common/terminal/syncTerminalService.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,7 @@ export class SynchronousTerminalService implements ITerminalService, Disposable
137137
const state = new ExecutionState(lockFile.filePath, this.fs, [command, ...args]);
138138
try {
139139
const pythonExec = this.pythonInterpreter || (await this.interpreter.getActiveInterpreter(undefined));
140-
// Npte that we ignore the returned "parse" value.
141-
// prettier-ignore
142-
const [sendArgs,] = internalScripts.shell_exec(command, lockFile.filePath, args);
140+
const sendArgs = internalScripts.shell_exec(command, lockFile.filePath, args);
143141
await this.terminalService.sendCommand(pythonExec?.path || 'python', sendArgs);
144142
const promise = swallowExceptions ? state.completed : state.completed.catch(noop);
145143
await Cancellation.race(() => promise, cancel);

src/client/testing/common/debugLauncher.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,7 @@ export class DebugLauncher implements ITestDebugLauncher {
159159

160160
const testArgs = this.fixArgs(options.args, options.testProvider);
161161
const script = this.getTestLauncherScript(options.testProvider);
162-
// Npte that we ignore the returned "parse" value.
163-
// prettier-ignore
164-
const [args,] = script(testArgs);
162+
const args = script(testArgs);
165163
configArgs.program = args[0];
166164
configArgs.args = args.slice(1);
167165
// We leave configArgs.request as "test" so it will be sent in telemetry.

src/client/testing/unittest/runner.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,7 @@ export class TestManagerRunner implements ITestManagerRunner {
142142
};
143143
return debugLauncher.launchDebugger(launchOptions);
144144
} else {
145-
// Npte that we ignore the returned "parse" value.
146-
// prettier-ignore
147-
const [args,] = internalScripts.visualstudio_py_testlauncher(testArgs);
145+
const args = internalScripts.visualstudio_py_testlauncher(testArgs);
148146

149147
const runOptions: Options = {
150148
args: args,

0 commit comments

Comments
 (0)