| Summary: | [1.8] Add content assist and/or quickfix to create lambdas (RFE) | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Colin Sharples <ctg> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 4.5.1 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 10 | ||
| Whiteboard: | |||
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 *** |
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.