Is there anyway to programmatically get the output of vscode task as vscode extension
Asked Answered
G

0

9

I am writing an vscode extension. I created a TaskProvider and registered some tasks to do some jobs before launching debug.

    const task = new vscode.Task(
      taskDefinition,
      scope,
      name,
      source,
      new vscode.ShellExecution("run some external command", options),
      problemMatchers
    );

I can register a onDidEndTaskProcess handler to get the exit code when a task process exits.

extensionContext.subscriptions.push(vscode.tasks.onDidEndTaskProcess(onDidEndTaskProcessHandler))

But from the vscode document, vscode.TaskProcessEndEvent only has an exitCode without other detailed information.

I would like to get the Error object and standard error of the process. Is there any way to do that?

Or is there any other better ways to determine why the task fails?

Gelation answered 22/6, 2021 at 7:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.