JavaDoc for constructors

Hi!

Is there a way to enable code completion for constructors? When creating a class instance I would like to get a list of possible constructors mainly to be able to get the JavaDoc popup for a constructor. As far as I know, this is the way it works in Eclipse and Netbeans (through simple code completion). Is this possible in IDEA?

Thanks,
rado

3
7 comments

Hello rado_p,

Is there a way to enable code completion for constructors? When
creating a class instance I would like to get a list of possible
constructors mainly to be able to get the JavaDoc popup for a
constructor. As far as I know, this is the way it works in Eclipse and
Netbeans (through simple code completion). Is this possible in IDEA?


Yes, of course. Press Ctrl-Space after typing "new".

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


-1

This does code completion only for the class name, but I don't see all the possible constructors in the list (i.e. there is only one item per class in the list). Furthermore, when I select an item and wait for Javadoc to popup, it gives me doc for the class, not for a constructor of the class.

1

try

new ArrayList(]]>

and press Ctrl+P (for "parameters")
this will show a popup with 1 line for each overloaded methods (works for constructors and regular methods), with expected arguments.

Not sure if you can see javadocs this way though

edit : ctrlshiftspace will offer the overloaded methods, with suggestions for values too

Edited by: Thibaut on Jul 1, 2008 7:00 PM

-1

I know of this feature and it's quite good. However, it still doesn't show the javadoc for the constructors. Sometimes the parameters information (Ctrl+P) is enough but sometimes you need more info and having to go away from the editor (to your web browser or IDE-internal javadoc browser) just to search for some javadoc slows you down. Both Eclipse and Netbeans have this. (but that doesn't help me now since I started using Idea :) ).

If it's not there, I think it could be considered for the next release. It could be configurable so users who like the current status could turn it off (or the rest of us could turn it on?).

1

rado_p wrote:

I know of this feature and it's quite good. However, it still doesn't
show the javadoc for the constructors.


I think Ctrl+Q is what you're looking for - it can be invoked on any
symbol, or even during smart complete.

N.

-1

I think Ctrl+Q is what you're looking for - it can be invoked on any
symbol, or even during smart complete.

N.


Unfortunately not. This still doesn't show you the constructor javadoc.

1
Avatar
Permanently deleted user

I am also about to switch from Eclipse to IntelliJ, however this missing feature bothers me, too. Have you found a solution since?

1

Please sign in to leave a comment.