Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 318728

Summary: [formatter/Comments] Formatting around Comments
Product: [Modeling] TMF Reporter: Manuel Hess <hessmanuel>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: hessmanuel, knut.wannheden, lieven.lemiengre, mark.g.j.christiaens, moritz.eysholdt
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Manuel Hess CLA 2010-07-02 10:24:51 EDT
Build Identifier: 1.0.0 

Locators before Comments are ignored

see http://www.eclipse.org/forums/index.php?t=msg&th=171127&start=0&

Reproducible: Always

Steps to Reproduce:
1. create the example project

2. modify the generated Formatting stub 
    GreetingElements ge = f.getGreetingAccess();
    c.setLinewrap(8).after(ge.getExclamationMarkKeyword_2());

3. Test with the following Valid Text
     Hello Manuel !
     // 8 Linewraps befor this comment
     Hello Michael !
Comment 1 Knut Wannheden CLA 2011-04-05 09:09:22 EDT
This (or a very similar) problem also applies to before() directives. If I for instance format the following Domainmodel example:

package foo00 { // NOTE THIS SL_COMMENT


	entity Foo00 {
		name : foo10.FOO10
	}
}

I end up with:

package foo00 { // NOTE THIS SL_COMMENT
	entity Foo00 {
		name : foo10.FOO10
	}
}

Whereas the same example without the SL_COMMENT remains unchanged after formatting.

Note: This was tested against Xtext 2.0 HEAD.
Comment 2 Moritz Eysholdt CLA 2016-07-21 04:27:16 EDT
won't fix because it affects the old formatter infrastructure