Invoking task indicator

Hey guys, new to nova api. Trying to improve one of existing extensions. Due to time it takes task to complete(can be few seconds up to 10-15 minutes, tests run) I want to have some indicator that would state if task still runs or not. It has simple approach -

  • invokes proc = new Process()
  • then proc.onDidExit() - I process results which were stored in json file during the run.

So I tried following approach

let task = new Task("Rspec run");
task.setAction(Task.Run, new TaskProcessAction('rspec-issues.runAllFiles'));

Unfortunately it won’t invoke the according TaskProcessAction(I put few console logs, but nothing invoked). What am I missing?

Any ways to put debugger and get it executed somehow?

Hello!

I’m afraid what you want to do might not be possible at the moment. The Process class is what you’ll want to use to invoke your subprocess, but it does not currently have a way to show a user interface element to indicate that something is “happening.” (however, I will absolutely take this as a feature request).

The Task API (and its action classes) does not itself launch subprocesses. It’s used to return tasks to the IDE to be displayed in the toolbar so the user can run them at their decision. Creating a Task object or one of its actions directly in code does not start the task, it’s just a description of what will run if a user does so.

1 Like

Hi Logan, thanks for response and thanks for taking this as feature request. I really enjoying nova but would want to bring some tools from other editors.

Although, how is the default tasks implemented, such as git push or git pull ?

Features that are built-into Nova do not use the extension API; We don’t currently have a way to do this exposed for third-party code.