Enhancement request: populate 'info' field for C completion

13 views
Skip to first unread message

Benjamin Fritz

unread,
Apr 10, 2012, 5:17:41 PM4/10/12
to eclim-dev
I like using "preview" in my completeopt option to get a popup window
which I can reference as I fill out a function call.

The completion menu provided with Eclim, although it works great,
sadly does not allow this feature of Vim to work, because it doesn't
populate the 'info' field.

Ideally the 'info' field would be populated with the function
prototype for functions, plus possibly the header comment above it,
similar to the hover text within Eclipse (but just the prototype would
be a great start).

For variables, the field probably need not be populated, but it would
be pretty awesome if you could somehow stick the definition of the
type in there if the variable has a complex type. It looks like
Eclipse just sticks the variable's declaration into the hover text.

Eric Van Dewoestine

unread,
Apr 12, 2012, 10:36:32 AM4/12/12
to ecli...@googlegroups.com

The issue with populating the info field is a matter of performance.
In the case of java completion it would be trivially easy for me to
include the full java docs of the method/field/class but eclipse
doesn't seem to cache that data so grabbing that info for each
completion adds a bit of overhead, which when there are a lot of
completion results, leads to a substantial degradation in performance.
So up to this point I've been limiting the data returned in
completions to what can be obtained with the least amount of impact on
speed.

I've even asked[1] Bram, back when vim's code completion support was
still alpha I believe, for some sort of hook to allow for lazy loading
of completion proposal info, but I apparently failed to convince him.

I'll look over code completion for each language and re-evaluate
what info can be returned, but I can't make any promises.

[1] http://tech.groups.yahoo.com/group/vimdev/message/43114

--
eric

Ben Fritz

unread,
Apr 26, 2012, 12:11:43 PM4/26/12
to ecli...@googlegroups.com
I did a completion today which brought up a preview window with function signatures automatically after selecting an item, because the function was overloaded (accidentally it turns out). As a compromise, could there be a setting to open this preview window automatically whenever you make a selection of a function name, rather than only if the function is overloaded? All I really need is the function signature, though it might also be nice to show something for variables and macros.

Eric Van Dewoestine

unread,
Apr 29, 2012, 1:20:22 PM4/29/12
to ecli...@googlegroups.com
I just updated the c/c++ completion to use the completion's display
string as the completion info if the display string includes the
signature or type information (something more than just the name).

https://github.com/ervandew/eclim/commit/71bed379bed2522a49be1f303dfb9c57e644ef71

--
eric

Ben Fritz

unread,
Apr 30, 2012, 11:28:47 AM4/30/12
to ecli...@googlegroups.com


On Sunday, April 29, 2012 12:20:22 PM UTC-5, Eric Van Dewoestine wrote:

I just updated the c/c++ completion to use the completion's display
string as the completion info if the display string includes the
signature or type information (something more than just the name).

https://github.com/ervandew/eclim/commit/71bed379bed2522a49be1f303dfb9c57e644ef71

--
eric


Works great, just what I needed. Thanks! 
Reply all
Reply to author
Forward
0 new messages