Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 532953 - [1.8][assist] Lambda expression auto completion
Summary: [1.8][assist] Lambda expression auto completion
Status: CLOSED DUPLICATE of bug 443091
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.7.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-27 08:33 EDT by Marvin Fröhlich CLA
Modified: 2018-03-27 10:31 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 Marvin Fröhlich CLA 2018-03-27 08:33:50 EDT
There should be a code assist completion option for functional interfaces.

Example1:
##################################################
BiConsumer<String, Integer> c = |
##################################################

Example2:
##################################################
consumeStuff( | );
##################################################

At the position of the text cursor there should be some possibility to auto complete the functional interface method signature for lambda expression. Of course this makes more sense for custom interfaces with more and actually named arguments.

The options should be:
* (1) Complete with argument name only (only available for single argument signatures)
* (2) Complete without argument types
* (3) Complete with argument types
* (4) Complete without argument types, but (curly) braces
* (5) Complete with argument types and (curly) braces

For example1:

Option (1) (and for a Consumer<String>) would lead to:
##################################################
Consumer<String> c = t -> |;
##################################################

Option (2) would lead to:
##################################################
BiConsumer<String, Integer> c = ( t, u ) -> |;
##################################################

Option (2) (and for a Consumer<String>) would lead to:
##################################################
Consumer<String> c = ( t ) -> |;
##################################################

Option (3) with configured next-line-braces would lead to:
##################################################
BiConsumer<String, Integer> c = ( String t, Integer u ) -> |;
##################################################

Option (4) with configured next-line-braces would lead to:
##################################################
BiConsumer<String, Integer> c = ( t, u ) ->
{
    |
};
##################################################

Option (4) with configured same-line-braces would lead to:
##################################################
BiConsumer<String, Integer> c = ( t, u ) -> {
    |
};
##################################################

Option (5) with configured next-line-braces would lead to:
##################################################
BiConsumer<String, Integer> c = ( String t, Integer u ) ->
{
    |
};
##################################################

Option (5) with configured same-line-braces would lead to:
##################################################
BiConsumer<String, Integer> c = ( String t, Integer u ) -> {
    |
};
##################################################
Comment 1 Noopur Gupta CLA 2018-03-27 10:31:00 EDT

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