asyncrun.vim icon indicating copy to clipboard operation
asyncrun.vim copied to clipboard

support location list.

Open ilAYAli opened this issue 7 years ago • 8 comments

It would be very nice with location list support, as I much prefer that to quickfix.

ilAYAli avatar Dec 06 '16 11:12 ilAYAli

Just like most IDE, asyncrun can support only one background job at the sametime. but different window has its own location list. that means when you are running 'AsyncRun' in different window, you will get a different result.

Supporting multi-job is a bit complex, for example, :AsyncStop must have a new parameter to indicate which job you want to stop, and :AsyncRun will returns current job id , and there must be a new :AsyncList to show currently running jobs.

There an both hard to implement and hard to use.

So, asyncrun is designed to run only one background job at the sametime, which will make my workflow much easier.

skywind3000 avatar Dec 09 '16 06:12 skywind3000

Agreed, but as a start, just allow a single invocation. Optionally make a subsequent job invocation, cancel the first. The latter is also preferable if you e.g AsyncRun make, and see that you have made a typo, so you want to fix the typo, and immediately restart the job.

ilAYAli avatar Dec 09 '16 07:12 ilAYAli

Just like most IDE, asyncrun can support only one background job at the sametime. but different window has its own location list. that means when you are running 'AsyncRun' in different window, you will get a different result.

Supporting multi-job is a bit complex, for example, :AsyncStop must have a new parameter to indicate which job you want to stop, and :AsyncRun will returns current job id , and there must be a new :AsyncList to show currently running jobs.

There an both hard to implement and hard to use.

So, asyncrun is designed to run only one background job at the sametime, which will make my workflow much easier.

Maybe user don't need to give a jobid paramter when calling :AsyncStop. If

  • there is only one job running, asyncrun will know what to do natrually
  • user input :AsyncStop while previously focused on a location list window, asyncrun might be able to tell which job is running in the location list window, and can stop that job. Though, for safty concerns, asyncrun might need to popup a confirm message to let user know which job he/she is stopping.
  • neither of the above happens, asyncrun could popup a selection windows to let the user choose which job to stop

I just installed asyncrun, and the first thing come up to me is: This is so coooool, and if it just can support multiple jobs, that will be much cooler!!

summer-tt avatar Jul 23 '20 10:07 summer-tt

Try -mode=term:

:AsyncRun -mode=term -pos=term  echo 1234 && sleep 3 && echo 56789

This command supports multiple tasks running at the same time.

skywind3000 avatar Jul 23 '20 15:07 skywind3000

@skywind3000

Unfortunately, seems like running -mode=term doesn't trigger AsyncRunStop.

The main problem with using quickfix is that, there's just one quickfix window. And many other plugins populate quickfix list as well, which messes up the output.

To give you an example, let's say I am running a build, in the meantime I am using vim-lsp to jump to the usage of a function, that also populates quickfix list, so the output is messed up.

So it'll be great to have location list support.

123subhadeep avatar Sep 19 '20 02:09 123subhadeep

I think it'll be even better if this plugin creates a buffer of its own. That way it can keep that singleton (i.e. no more than one runs), also it won't conflict with other plugins.

I think it's not ideal to use quickfix, as there's only one of it, and many plugins throw their result onto it, which messes it up.

123subhadeep avatar Sep 19 '20 03:09 123subhadeep

Agreed, but as a start, just allow a single invocation. Optionally make a subsequent job invocation, cancel the first. The latter is also preferable if you e.g AsyncRun make, and see that you have made a typo, so you want to fix the typo, and immediately restart the job.

I agree with this. Multiple jobs is nice, but it's not a pre-requisite to location list support. You could still serialize jobs even with location list, and just don't allow further AsyncRun calls while a job is running. The benefit to location list is just to have multiple quickfix lists to choose from (e.g. on one window you did a grep, and on the other window you invoked make to compile). They don't have to all run at the same time.

ychin avatar Sep 20 '20 01:09 ychin

In the meanwhile, give tasks a whirl.

Konfekt avatar Aug 12 '21 14:08 Konfekt