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 #1765015] Mon, 05 June 2017 17:17 Go to next message
lac troi is currently offline lac troiFriend
Messages: 1
Registered: June 2017
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 #1765201 is a reply to message #1765015] Wed, 07 June 2017 13:37 Go to previous message
Lucio Menci is currently offline Lucio MenciFriend
Messages: 2
Registered: June 2017
Junior Member
I hope that you can write the field name...

Write this:
field = object.someFunctionReturningValue();

Eclipse will sign the field field as an error. Press Ctrl + , to find it, then F2 and Enter to accept the Create local variable sudgestion.
Previous Topic:Formatter alignment vs indentation
Next Topic:ejc failing to build with StackOverflowError
Goto Forum:
  


Current Time: Sat Sep 23 05:46:11 GMT 2017

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

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