Bug 546963 - [content assist] Override method: wrong indentation with class Java doc comment
Summary: [content assist] Override method: wrong indentation with class Java doc comment
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.12   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-03 08:32 EDT by Simeon Andreev CLA
Modified: 2023-06-12 16:02 EDT (History)
2 users (show)

See Also:


Attachments
Example project to reproduce the problem with. See reproduction steps in bug description. (2.06 KB, application/zip)
2019-05-03 08:32 EDT, Simeon Andreev CLA
no flags Details
Video showing the problem with the reproduction steps from the bug description. (766.84 KB, video/mp4)
2019-05-03 08:32 EDT, Simeon Andreev CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simeon Andreev CLA 2019-05-03 08:32:19 EDT
Created attachment 278489 [details]
Example project to reproduce the problem with. See reproduction steps in bug description.

Reproduction steps:

1. Import project from attached archive "ExampleProject.zip".
2. Open type "somepackage.Sub".
3. Move the cursor before the existing method in the class.
4. Type "my" and invoke content assist.
5. Choose "myMethod" content assist proposal.
6. Observe bad formatting:

	@Override
		public void myMethod() {
			// TODO Auto-generated method stub
			super.myMethod();
		}

7. Expected formatting is:

	@Override
	public void myMethod() {
		// TODO Auto-generated method stub
		super.myMethod();
	}

Further notes:

a) Removing the class Java doc comment of "Sub.java" seems to prevent the issue.
b) Ctrl+Z after the content assist invoke in steps 5. and 6. seems to also ensure that the next content assist invoke has correct formatting.

See also attached video "formatter_wrong_indentation_with_class_javadoc.mp4".

Seen with:

Eclipse SDK
Version: 2019-06 (4.12)
Build id: I20190402-1800

RHEL 7.4
GTK 3.22

Also seen with 4.10, not sure about earlier versions.
Comment 1 Simeon Andreev CLA 2019-05-03 08:32:45 EDT
Created attachment 278490 [details]
Video showing the problem with the reproduction steps from the bug description.
Comment 2 Mateusz Matela CLA 2019-06-10 17:58:22 EDT
Seems like a content assist issue, moving to jdt-text.
Comment 3 Eclipse Genie CLA 2021-05-31 11:48:55 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 4 Eclipse Genie CLA 2023-06-12 16:02:45 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.