Re: RFC: Signature help/argument hints in a second popup menu

2018-11-07 Fir de Conversatie Garrett Smith
+1

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


Re: RFC: Signature help/argument hints in a second popup menu

2018-09-19 Fir de Conversatie lzfmars
在 2018年2月1日星期四 UTC+8下午8:47:28,skywind3000写道:
> +1
> +1

+1

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


Re: RFC: Signature help/argument hints in a second popup menu

2018-09-12 Fir de Conversatie boris . staletic
On Saturday, December 23, 2017 at 12:23:43 PM UTC+1, Ben Jackson wrote:
> Hi Bram and community,
> 
> I have prepared a brief request for comments on a proposed new Vim feature 
> which I am personally very keen on, but would like to gauge the appetite for 
> it and the thoughts of the community and maintainers at large before actually 
> embarking on a proper implementation.
> 
> The feature is IDE-like display of the method signature being entered at the 
> same time as the insert-mode completion menu.
> 
> The RFC is best viewed in a gist here and includes a POC and some demos in 
> animated-gif form: 
> https://gist.github.com/puremourning/3ac3be4527ee094250ae516fc26561a2
> 
> It's also replicated below for those that prefer plaintext :)
> 
> I'd be super grateful for any responses, comments, flames, ideas or even 
> insults ;)
> 
> Cheers,
> Ben
> 
> ---
> 
> # TL;DR
> 
> This RFC proposes introducing a second popup menu in insert mode to display
> method argument hints, current parameter, etc. similar to a number of IDEs and
> editors. The proposal is to allow scripts to control this (such as on insert 
> of
> `(` and `)` characters) and for it to be non-interractive and not to interfere
> with insert-mode completion.
> 
> The purpose of the RFC is to guage the appetite from Bram and the community 
> for
> such a feature, and to discuss the design/functional behaviours prior to
> committing to an implementation/etc.
> 
> # Motivation
> 
> There are a number of Vim plugins which attempt to provide some IDE-like
> features using Vim's completion system, in combination with omnifuncs and
> insert-mode completion that is built-in. Examples:
> 
> - YouCompleteMe - https://github.com/Valloric/YouCompleteMe
> - neocomplete, deoplete, neocomplcache, and other friends
> - eclim?
> - any number of hundreds of omnifuncs
> - Microsoft language server client?
> - Various other "async complete" plugins
> - possibly any number of other completion plugins, including implementations
>   specific to particular languages (e.g. using omnifunc), or using l
> 
> In their simplest form, these provide a list of identifiers which are
> semantically valid to be inserted at the current cursor position (or the 
> result
> of the equivalent of omnifunc's 'findstart' request), using the insert-mode
> completion APIs provided by Vim.
> 
> One of the most commonly requested features for YouCompleteMe is the ability 
> to
> display the valid arguments for function calls, as well as semantically 
> correct
> identifiers. This feature is known as "argument hints", "parameter
> completions", "signature help" or suchlike. 
> [Microsoft's Language Server Protocol][lsp] refers to them as "Signature 
> Help".
> 
> # Illustrative example
> 
> For example, the user types something like the following, with the cursor on
> `^`:
> 
> ```c
> 
> typedef struct pum_T 
> {
>   int pum_item_count;
>   int pum_selected;
>   pumitem_T* items[];
> } pum;
> 
> void pum_display_item( pum_T* pum,
>char_u* message,
>pumitem_T* item_list );
> 
> void pum_display_item( pum_T* pum,
>int selected_item,
>pumitem_T* item );
> 
> void main(void)
> {
>   pum_T pum = init_pum();
>   pum_display_item( pum, pum.^
> }
> 
> ```
> 
> Current completion systems (or omni-completion, invoked with ``) 
> would
> typically present a popup menu with the valid options from the definition,
> such as:
> 
> - `int pum_selected`
> - `int pum_item_count`
> 
> Methods often have many more arguments than this toy example, and
> the declaration is not likely visible when it is used. Instead, many IDEs and
> other editors provide a second "popup" when the user types the `(`. Typically,
> this is _above_ rather than below the current line and contains the list of
> overloads of the fucntion and their arguments, often highlighting (one way or
> another) the "current" argument being entered.
> 
> For example, it might look like this:
> 
> ||
> | pum_display_item( pum_T* pum, **char_u *message**, pumitem_T* item )   |
> | pum_display_item( pum_T* pum, **int selected_item**, pumitem_T* item ) |
> ||
> pum_display_item( pum, pum.^
>|---|
>| pum_selected int  |
>| int pum_item_count   int  |
>|---|
> 
> # Known existing attempts in Vim
> 
> - **The preview window.**
>   By using the extra data in the completion menu item structure, we can show
>   some static information in the preview window. The drawbacks are that the
>   preview window has to always be visible (taking up valuable screen real
>   estate), or it pops in and out of visibility, causing the 

Re: RFC: Signature help/argument hints in a second popup menu

2018-08-13 Fir de Conversatie Blay263
On Thursday, February 1, 2018 at 7:47:28 AM UTC-5, skywind3000 wrote:
> +1
> +1

+1

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


Re: RFC: Signature help/argument hints in a second popup menu

2018-02-01 Fir de Conversatie skywind3000
+1
+1

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


Re: RFC: Signature help/argument hints in a second popup menu

2018-01-25 Fir de Conversatie Wei Zhang
I really like this feature. 

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


RFC: Signature help/argument hints in a second popup menu

2017-12-23 Fir de Conversatie Ben Jackson
Hi Bram and community,

I have prepared a brief request for comments on a proposed new Vim feature 
which I am personally very keen on, but would like to gauge the appetite for it 
and the thoughts of the community and maintainers at large before actually 
embarking on a proper implementation.

The feature is IDE-like display of the method signature being entered at the 
same time as the insert-mode completion menu.

The RFC is best viewed in a gist here and includes a POC and some demos in 
animated-gif form: 
https://gist.github.com/puremourning/3ac3be4527ee094250ae516fc26561a2

It's also replicated below for those that prefer plaintext :)

I'd be super grateful for any responses, comments, flames, ideas or even 
insults ;)

Cheers,
Ben

---

# TL;DR

This RFC proposes introducing a second popup menu in insert mode to display
method argument hints, current parameter, etc. similar to a number of IDEs and
editors. The proposal is to allow scripts to control this (such as on insert of
`(` and `)` characters) and for it to be non-interractive and not to interfere
with insert-mode completion.

The purpose of the RFC is to guage the appetite from Bram and the community for
such a feature, and to discuss the design/functional behaviours prior to
committing to an implementation/etc.

# Motivation

There are a number of Vim plugins which attempt to provide some IDE-like
features using Vim's completion system, in combination with omnifuncs and
insert-mode completion that is built-in. Examples:

- YouCompleteMe - https://github.com/Valloric/YouCompleteMe
- neocomplete, deoplete, neocomplcache, and other friends
- eclim?
- any number of hundreds of omnifuncs
- Microsoft language server client?
- Various other "async complete" plugins
- possibly any number of other completion plugins, including implementations
  specific to particular languages (e.g. using omnifunc), or using l

In their simplest form, these provide a list of identifiers which are
semantically valid to be inserted at the current cursor position (or the result
of the equivalent of omnifunc's 'findstart' request), using the insert-mode
completion APIs provided by Vim.

One of the most commonly requested features for YouCompleteMe is the ability to
display the valid arguments for function calls, as well as semantically correct
identifiers. This feature is known as "argument hints", "parameter
completions", "signature help" or suchlike. 
[Microsoft's Language Server Protocol][lsp] refers to them as "Signature Help".

# Illustrative example

For example, the user types something like the following, with the cursor on
`^`:

```c

typedef struct pum_T 
{
  int pum_item_count;
  int pum_selected;
  pumitem_T* items[];
} pum;

void pum_display_item( pum_T* pum,
   char_u* message,
   pumitem_T* item_list );

void pum_display_item( pum_T* pum,
   int selected_item,
   pumitem_T* item );

void main(void)
{
  pum_T pum = init_pum();
  pum_display_item( pum, pum.^
}

```

Current completion systems (or omni-completion, invoked with ``) would
typically present a popup menu with the valid options from the definition,
such as:

- `int pum_selected`
- `int pum_item_count`

Methods often have many more arguments than this toy example, and
the declaration is not likely visible when it is used. Instead, many IDEs and
other editors provide a second "popup" when the user types the `(`. Typically,
this is _above_ rather than below the current line and contains the list of
overloads of the fucntion and their arguments, often highlighting (one way or
another) the "current" argument being entered.

For example, it might look like this:

||
| pum_display_item( pum_T* pum, **char_u *message**, pumitem_T* item )   |
| pum_display_item( pum_T* pum, **int selected_item**, pumitem_T* item ) |
||
pum_display_item( pum, pum.^
   |---|
   | pum_selected int  |
   | int pum_item_count   int  |
   |---|

# Known existing attempts in Vim

- **The preview window.**
  By using the extra data in the completion menu item structure, we can show
  some static information in the preview window. The drawbacks are that the
  preview window has to always be visible (taking up valuable screen real
  estate), or it pops in and out of visibility, causing the current row to
  shift disconcertingly on the screen. Requires `preview` in the `completeopt`
  and other autocmds etc. to show/hide it. Cursor moving into and out of
  the preview window triggers `BufEnter` autocoms, which causes meaningful lag
  when the completion menu is visible (OK, this could be blamed mostly on the
  plugins using