Skip to main content



      Home
Home » Newcomers » Newcomers » how to get code-assist for constructors
how to get code-assist for constructors [message #269728] Tue, 24 March 2009 11:53 Go to next message
Eclipse UserFriend
"code-assist" may not be the right name. When typing code, if I type
"{object-instance}." Eclipse then gives me a list of the methods and
fields that can follow the ".". But how can I get this for constructors.

I saw a thread where someone else asked about this. He was told to use
Ctrl-space. Two problems:

1) after typing "new " and Ctrl-space, Eclipse does not list
constructors for classes I have written. Note that my classes may be in
another project that is in the workspace. Eclipse does know about my
class because I have have an instance of the class and it knows the
fields and methods to display after the ".".

2) after typing "new className(" and Ctrl-space, it shows me the
constructor signatures (eg. Foo(int, int, int) ), but it does not show
me the names of the parameters like it would for methods.

So is there another solution?

Thanks,
Paul
Re: how to get code-assist for constructors [message #269745 is a reply to message #269728] Wed, 25 March 2009 08:12 Go to previous messageGo to next message
Eclipse UserFriend
Paul Levin wrote:
> "code-assist" may not be the right name. When typing code, if I type
> "{object-instance}." Eclipse then gives me a list of the methods and
> fields that can follow the ".". But how can I get this for constructors.
>
> I saw a thread where someone else asked about this. He was told to
> use Ctrl-space. Two problems:
>
> 1) after typing "new " and Ctrl-space, Eclipse does not list
> constructors for classes I have written. Note that my classes may be
> in another project that is in the workspace. Eclipse does know about
> my class because I have have an instance of the class and it knows the
> fields and methods to display after the ".".
You need to type at least the first character of your class and then
press Ctrl+Space. In 3.4 and earlier this will show the types and in
latest 3.5 builds you will get constructor proposals.

Dani
>
> 2) after typing "new className(" and Ctrl-space, it shows me the
> constructor signatures (eg. Foo(int, int, int) ), but it does not show
> me the names of the parameters like it would for methods.
>
> So is there another solution?
> Thanks,
> Paul
Re: how to get code-assist for constructors [message #269747 is a reply to message #269745] Wed, 25 March 2009 10:55 Go to previous message
Eclipse UserFriend
Thank you Daniel. I believe it is working now. Part of my problem was
that I set a filter for class types (not realizing what that setting was
for). When I cleared those filters my constructors came back in the list.

Also I found that after having the name of the class, I can type "(" and
ctrl-space and now I'm getting the list of constructors with the
parameter names.

Thanks again for your reply.

Paul


Daniel Megert wrote:
> Paul Levin wrote:
>> "code-assist" may not be the right name. When typing code, if I type
>> "{object-instance}." Eclipse then gives me a list of the methods and
>> fields that can follow the ".". But how can I get this for constructors.
>>
>> I saw a thread where someone else asked about this. He was told to
>> use Ctrl-space. Two problems:
>>
>> 1) after typing "new " and Ctrl-space, Eclipse does not list
>> constructors for classes I have written. Note that my classes may be
>> in another project that is in the workspace. Eclipse does know about
>> my class because I have have an instance of the class and it knows the
>> fields and methods to display after the ".".
> You need to type at least the first character of your class and then
> press Ctrl+Space. In 3.4 and earlier this will show the types and in
> latest 3.5 builds you will get constructor proposals.
>
> Dani
>>
>> 2) after typing "new className(" and Ctrl-space, it shows me the
>> constructor signatures (eg. Foo(int, int, int) ), but it does not show
>> me the names of the parameters like it would for methods.
>>
>> So is there another solution?
>> Thanks,
>> Paul
Previous Topic:Adding Selection Listener for CTab Item
Next Topic:Re: Active Project Handling - Howto
Goto Forum:
  


Current Time: Wed Jul 09 08:57:24 EDT 2025

Powered by FUDForum. Page generated in 0.12031 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top