On 2014-03-05 18:32:40, Boris Month wrote:
> When I use <C-X><C-U> in the following scenario i get a nice list of
> possible method signatures for charAt if I take the time to search the list
> of suggestions for charAt.
> String b = new String("abcd");
> b.
>
> Using set completeopt+=menuone as you suggested here
>
https://groups.google.com/forum/#!topic/eclim-user/w_yrndBUufM allows the
> same even if I already typed out:
> b.chatAt
If you have 'preview' in your completeopt as well then vim will open a
preview window which shows the full method signature (no docs though
since that kills performance with the way vim's code completion
works). In the case that the method is overloaded, the preview window
will show all the possible method signatures. That window will stay
open after you've chosen a completion so that you can reference those
signatures.
> (By the way, could you explain where one could find out that an option like
> set compelteopt+=menuone exists and that this is what one i looking for,
> without searching or asking on the mailing list?)
In this case the best way is to become familiar with vim's docs. Vim
has some great docs but it takes some time dealing with them to know
how to find what you're looking for. If I don't know exactly the right
help topic to open, I'll usually type out part of a topic name and use
vim's command tab completion to see what topics are available. For
instance to see completion topics:
:h complet<TAB>
Enabling wildmenu makes this even easier to visualize (add these to
your vimrc):
set wildmenu
set wildmode=longest:full,full
> This also works for methods I implemented myself, so <C-X><C-U> plus the
> set compelteopt+=menuone setting was what I was looking for I guess.
> :JavaDocPreview will display more verbose which is not what I was searching
> for.
>
> However this doesn't work for calls to the constructor of a Class. The
> :JavaDocPreview command will not give any Information on the Consturctor
> parameters either, since it will display the JavaDoc of the Class itself
> and not the one of the constructor. Is there a way display the method
> signatures of a Consturctor?
Hmm, seems to work for me. If I have code like so:
List someList = new ArrayList<String)(capacity);
When I place the cursor somewhere on 'ArrayList' and type
:JavaDocPreview, I get the docs for that constructor.
> The way I use :JavaDocPreview is that I write out the method i am looking
> for leaving the parameterlist empty. E.g.:
> String a = new String("abc");
> a.charAt();
>
> Now I would position my cursour on charAt and issue :JavaDocPreviwe. Please
> correct me if I'm doing something wrong here.
>
> This works fine as long as the method isn't overloaded, cause if it is only
> the javadoc of one of the methods will be displayed, or am I doing
> something wrong here?
:JavaDocPreview is intended to just show you the docs for a single
element, but perhaps it could be updated to link to all overridden
versions of that method? I'm not sure off hand how much work that
would be to add.
There is also :JavaDocSearch that will open up the javadocs in your
browser and from there you can view all constructors, methods, etc.
--
eric