Code Monkey home page Code Monkey logo

async.vim's People

Contributors

bmtsstl avatar iamfirecracker avatar idbrii avatar infokiller avatar k-takata avatar lambdalisue avatar mattn avatar prabirshrestha avatar rhysd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

async.vim's Issues

Why s:job_supported_types?

It appears that async.vim is trying to support a theoretical vim program that contained both the vim and nvim job api. Why?

s:job_supported_types builds a list of supported types, but won't there ever only be one type value for each platform? Even you we added a system() fallback, you'd only use that if jobs were unavailable.

I wanted to ask in case I misunderstood something before working on a simplifying PR.

Stepping buffer size is smaller

Current implementation use 1024. This is smaller.

vim/vim#3782

I send pull-request to vim/vim to make large size for Windows named pipe. When this pr is merged, we can change this size to 8192.

Shall we have a "close stdin" function?

For some programs, no output will be given until its stdin is closed. One example is fzf when it is being used as a filter to find matches in what's provided from stdin. I was using fzf to write a preprocessor for asyncomplete.vim, and having no "close stdin" function makes it hard to use async.vim to make the code compatible with both vim and nvim.

My current solution is adding a close_stdin function as what's done here. This solution is kinda awkward, as it doesn't follow the "interface similar to nvim" as other functions in this project. Also, at this point I don't think it is possible to create an interface which is compatible with vim that does everything nvim's interface does: nvim's chanclose can close stdin, stdout or stderr, while vim only provides ch_close which closes all channels and ch_close_in which closes stdin.

Does this still work with Vim?

In my testing this works very well with neovim, but with vim not so much... I have script that is called from BufEnter autocommand, and in neovim it triggers but in vim it does not seem to trigger on BufEnter, it seems to trigger on VimLeavePre though.

Unit tests?

This seems like a really promising vim library. I'd like to see more projects migrating to rely on this, if it's robust enough. I'd love to be able to move the if has('nvim') clauses out of my vimrc.

That being said, are you planning on adding unit tests? I don't have much time on my hands, but I may be able to help out if you can get something started. I'm not sure if you have a favorite vim testing framework yet, but I have some experience using vroom.

Question: Is the race condition at vim 8 OK? / Suggestion: fix method

Question:

I made a proposal for function summarization at asyncomplete-tags.vim. [asyncomplete-tags.vim issues # 9] (prabirshrestha/asyncomplete-tags.vim#9)

But I thought that the proposal would be difficult with async.vim's close / exit property of vim 8, and I closed it once.

It seems async.vim does not follow-up with this specification.
Or mode=raw was not affect?

see below

elseif l:jobtype == s:job_type_vimjob
let s:jobidseq = s:jobidseq + 1
let l:jobid = s:jobidseq
let l:job = job_start(a:cmd, {
\ 'out_cb': function('s:out_cb', [l:jobid, a:opts]),
\ 'err_cb': function('s:err_cb', [l:jobid, a:opts]),
\ 'exit_cb': function('s:exit_cb', [l:jobid, a:opts]),
\ 'mode': 'raw',
\})

and

https://github.com/prabirshrestha/asyncomplete-tags.vim/blob/c3c575a62a34661134e9e9427fdcc46dc50a5069/autoload/asyncomplete/sources/tags.vim#L158-L186

reference : other job-wrapper implementation.

https://github.com/lambdalisue/vital-Whisky/blob/master/autoload/vital/__vital__/System/Job/Vim.vim#L43-L64

and document

https://github.com/lambdalisue/vital-Whisky/blob/master/doc/Vital/System/Job.txt#L111-L114


Suggestion:

If require workaround in async.vim, what kind of countermeasures do you consider and do?

  1. no care, because not affect.
  2. like asyncomplete-tags.vim workaround : both status checking
  3. like vital-Whisky System.Job(vim8) workaround : exit wait channel is done

distribute as a package

It would be useful to switch to a package layout, i.e. put the async.vim inside
start/async/autoload/async.vim
Then the user would put it under pack/async. Check :h package-create. I checked that this works in vim-8 and nvim-0.2.0.

This would also solve FrigoEU/psc-ide-vim#61

add rpc support

I have been thinking of having rpc support for quite sometime. This would be provided by rpc.vim which depends on job.vim. It could then use stdin/stdout to communicate with the servers.

Bug in the Readme example

Hi, I just tried out the example from the Readme and it crashes in the handler on_exit due to a:data being of type number and not list.

function! s:handler(job_id, data, event_type)
    echo a:job_id . ' ' . a:event_type
    " Error happens here as join() expects a list
    echo join(a:data, "\n")
endfunction

Am I correct that this is simply a bug because on_exit returns the status code of the command?

I am running Vim version 8.2 1-4745.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.