Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318728 - [formatter/Comments] Formatting around Comments
Summary: [formatter/Comments] Formatting around Comments
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-02 10:24 EDT by Manuel Hess CLA
Modified: 2016-07-21 04:27 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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