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

Bug 339997

Summary: [formatter] Formatter matches missing elements
Product: [Modeling] TMF Reporter: Carl Wannheden <carl.wannheden>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: moritz.eysholdt, stephane
Version: 0.8.0Flags: moritz.eysholdt: indigo+
Target Milestone: M7   
Hardware: All   
OS: All   
Whiteboard:

Description Carl Wannheden CLA 2011-03-15 07:09:27 EDT
Build Identifier: M20110210-1200

This is a regression, probably related to Bug 336235.
The following Domainmodel example:
  entity D { }
formats differently in Xtext 1.0.2 than before.

Reproducible: Always

Steps to Reproduce:
1. Create Domainmodel source
  entity D { }
2. In M20110210-1200 it formats as

entity D {
}

3. In prior versions it formats as

entity { }
Comment 1 Moritz Eysholdt CLA 2011-04-01 05:44:11 EDT
Hi Carl,

I can confirm that in the domain-model-example, the formatting-rule 

-----
c.setLinewrap(1, 1, 2).around(f.getFeatureRule());
-----

matches 

-----
Entity:	'entity' name=ID ('extends' superType=JvmTypeReference)? '{'
    features+=Feature*
'}';
-----


even thought Entity.features is an empty list.

This shouldn't be the case because when Entity.features is empty the rule Feature is never called.
Comment 2 Moritz Eysholdt CLA 2011-04-04 10:13:49 EDT
fixed in HEAD