jbakam wrote:

> I am trying to make use of convenient balloon evaluation feature in
> order to be able to display certain information about the source code
> (e.g. function prototypes, function documentation, corresponding
> variable data type, etc.).
> 
> This is per se already possible with 'balloonexpr' but it is possible
> to do so only in a synchronous way (e.g. all computation needs to be
> done at once in 'balloonexpr'). What I am trying to do is to have it
> working in an asynchronous way. E.g.
>   1. Fire a request for some certain information (there is a server serving 
> these requests in the background).
>   2. Don't necessarily wait for a request to be served. I.e. continue your 
> work in vim.
>   3. Once the request is served and our vim thread receives a callback with 
> corresponding information, display it in a balloon.
> 
> In order to be able to implement this approach, I would need a possibility:
>   1. To hook on a mouse hover event.
>   2. To feed the balloon content with dedicated function.
> 
> I believe the infrastructure/code for this already exists but it is
> not exposed through Vim API. Do you think this would be feasible
> enough to implement and would you even consider such a change?
> 
> Thanks for your time,
> J. Bakamovic
> 
> P.S. I am working on a generic client-server approach here which I use
> to implement a lot of non-trivial IDE-like services (e.g. think
> indexer, semantic highlighting, code-completion, type deduction,
> etc.). By nature all these services run asynchronously.

This should be possible in a way similar to what the netbeans interface
does.  

Triggering the evaluation happens in general_beval_cb().  It calls
netbeans_beval_cb().  This can work by setting 'balloonexpr', but have
it return an empty string, so that nothing shows up yet.  Thus that
already works.

Showing the balloon (tooltip) happens with the "showBalloon" netbeans
command, which calls gui_mch_post_balloon().  We would need a way to
make this work with a channel command.  Using "call" is probably the
simplest, then we only need to add a function that shows the balloon.

Another thing that would be nice: Also make this work in the terminal.
Could be implemented like we have the popup menu.  Should be as simple
as balloon_show().  For completenes we could add balloon_hide().
Perhaps you could implement that?

-- 
An indication you must be a manager:
You believe you never have any problems in your life, just
"issues" and "improvement opportunities".

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui