Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Autocomplete function return value
Autocomplete function return value [message #698774] Wed, 20 July 2011 08:06 Go to next message
Mike Dundee is currently offline Mike DundeeFriend
Messages: 9
Registered: November 2010
Junior Member
Hello,

let's say that I invoked Content Assist (Ctrl+Space) on some object.
I scroll through list of methods and choose some which returns a value.
the following code appears in my source editor:

object.someFunctionReturningValue();

However if function returns some complicated value with many generics, I would be convenient if eclipse could read function signature and automatically generate field to which function return value is assigned,
ie I would like the following code to appear in my code editor:

Map<Long,List<String>> field = object.someFunctionReturningValue


Is there any way how to achieve this?

Thank you
Re: Autocomplete function return value [message #698896 is a reply to message #698774] Wed, 20 July 2011 12:39 Go to previous messageGo to next message
Deepak Azad is currently offline Deepak AzadFriend
Messages: 543
Registered: July 2009
Senior Member
On 7/20/2011 1:36 PM, Mike Dundee wrote:

> object.someFunctionReturningValue();

After you finish typing this, press Ctrl+1 (you may have to move the
caret before the ;) and then use 'Assign statement to new local
variable' or 'Assign statement to new field'.
Re: Autocomplete function return value [message #699051 is a reply to message #698896] Wed, 20 July 2011 17:57 Go to previous message
Mike Dundee is currently offline Mike DundeeFriend
Messages: 9
Registered: November 2010
Junior Member
Thank you very much. I have been using Ctrl+1 only for handling errors until now (didn't know that it can be used in other context).
Previous Topic:Java Model Status "Invalid name specified" exception - Possible bug
Next Topic:keep Loading web service DOM...(waiting) upgrade to eclipse 3.7
Goto Forum:
  


Current Time: Thu Apr 25 04:26:27 GMT 2024

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

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

Back to the top