skywind3000 / asyncrun.vim

:rocket: Run Async Shell Commands in Vim 8.0 / NeoVim and Output to the Quickfix Window !!
https://www.vim.org/scripts/script.php?script_id=5431
MIT License
1.86k stars 111 forks source link

support location list. #24

Open ilAYAli opened 7 years ago

ilAYAli commented 7 years ago

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

skywind3000 commented 7 years ago

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.

ilAYAli commented 7 years ago

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.

summer-tt commented 4 years ago

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

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!!

skywind3000 commented 4 years ago

Try -mode=term:

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

This command supports multiple tasks running at the same time.

123subhadeep commented 4 years ago

@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 commented 4 years ago

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.

ychin commented 4 years ago

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.

Konfekt commented 3 years ago

In the meanwhile, give tasks a whirl.