Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 492406 - [1.8] Add content assist and/or quickfix to create lambdas (RFE)
Summary: [1.8] Add content assist and/or quickfix to create lambdas (RFE)
Status: CLOSED DUPLICATE of bug 443091
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.5.1   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-25 18:04 EDT by Colin Sharples CLA
Modified: 2016-04-25 20:05 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Colin Sharples CLA 2016-04-25 18:04:00 EDT
It would be nice to have built-in support for creating lambdas, i.e. via content assist and/or quickfix.

For example, when you call a method that takes a functional interface as a parameter, you can invoke content assist to create a new anonymous class by typing "new " and then ctrl+space. It would be ideal to have a lambda version of the interface available as an option as well as the anonymous class. It's possible to write a code template to insert a generic lambda template, e.g. "(${cursor}) -> {}", but it would need proper JDT support to inspect the interface for argument names and construct a fully populated lambda template.

At present, if you don't know the interface arguments, your only option is to create the anonymous class and then convert to lambda, which is extra work.
Comment 1 Colin Sharples CLA 2016-04-25 20:05:19 EDT
Apologies, this is a duplicate of bug #443091 - I didn't find that when searching to see if it was already requested.

*** This bug has been marked as a duplicate of bug 443091 ***