Bug 570686 - Braces auto-completion causes syntax error when used before multiple line comment
Summary: Braces auto-completion causes syntax error when used before multiple line com...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.19   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-27 06:51 EST by Martin Coufal CLA
Modified: 2021-01-27 06:52 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Coufal CLA 2021-01-27 06:51:36 EST
When typing in editor, Eclipse will automatically format the text after the left bracket symbol when 'enter' is pressed. But when used before multiple line comment, it places the right bracket inside the multiple line comment.

I'm not sure if there's an easy way to go around this and whether it is worth the effort fixing since this is the default behaviour, but it causes unwanted syntax errors.

How to reproduce:
1. run eclipse
2. create Java project with a new class
3. have following code:
'''
package testJava;


public class TestClass{
	/*
	multi
	line
	comment*/
}
'''
4. type 'void foo() {' just before start of the comment '/*' and press enter

Right bracket is now inside the multi-line comment:
'''
void foo() {
		/*
	}
	multi
	line
	comment*/
'''

My configuration:
Eclipse Platform 4.19.0.I20210124-1800
org.eclipse.jdt.feature.group 3.18.700.v20210106-1800