Bug 533639 - [typing] Linebreak in lamda confuses indentation
Summary: [typing] Linebreak in lamda confuses indentation
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.7.3   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-16 15:27 EDT by Frank Benoit CLA
Modified: 2023-05-20 10:28 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Benoit CLA 2018-04-16 15:27:15 EDT
Example:
import java.util.Comparator;

public class FormatterBug {
//	private final Comparator<Long> findBlockIndexByTimeComparator = (t, 
//			k)-> Long.compare(t, k);
	private final Comparator<Long> findBlockIndexByTimeComparator = (t, k) 
			-> Long.compare(t, k);
			
			
			public FormatterBug() {
			}
}


The Ctor should not be indented so far.
This indentation is kept for the remaining file.
Trigger with the first commented code or with the active.
Comment 1 Mateusz Matela CLA 2018-04-21 19:09:16 EDT
I did some tests and I don't see the problem when invoking the formatter (through Ctrl+Shift+F), but only when pressing Enter in code to add new lines.
Moving to jdt.text.

Probably related to bug 476636.

Frank, please let us know if I missed something.
Comment 2 Frank Benoit CLA 2019-03-16 08:04:27 EDT
Yes, right it is not about the formatter, it is about the indenter.
If I want to keep the line break before the ->, the following is all wrongly indented.
Select All, then indent: CTRL-A, CTRL+I
Now with Eclipse 4.10 still the case.
Comment 3 Frank Benoit CLA 2019-05-05 04:43:04 EDT
Same behavior in 4.11.
Comment 4 Eclipse Genie CLA 2021-04-26 17:59:18 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 5 Eclipse Genie CLA 2023-05-20 10:28:08 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.