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

Bug 345574

Summary: Acceleo traceability does not link text generated using enum.toString()
Product: [Modeling] Acceleo Reporter: macjariel
Component: CoreAssignee: Project Inbox <acceleo-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: stephane.begaudeau
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description macjariel CLA 2011-05-12 06:48:19 EDT
Build Identifier: 20110218-0911

I am trying to develop a DSL debugger and I decided to use Acceleo and its traceability model to link between DSL and generated GPL.

However, when I try print an enum in my template, Acceleo does not generate traceability information for that text.

Reproducible: Always

Steps to Reproduce:
To reproduce, consider the following testcase.
I have this simple Xtext grammar of my DSL:

Model:
	(statements+=Statement)*;
	
Statement:
	kind=CommandKind ";";

enum CommandKind:
	STEP="step" |
	TURNLEFT="turnLeft" |
	TURNRIGHT="turnRight";

Then I use this Acceleo template to generate the code:

[template public generate(m: Model)]
[comment @main /]
[file ('output', false, 'UTF-8')]
[for (st: Statement | m.statements)]
	[self.kind.toString() /];
[/for]
[/file]
[/template]


I use the following DSL model:

step;
turnLeft;
turnRight;

I try to generate the code and set Acceleo to show the traceability model in the result view. Then I double click at one of the statements in the view and generated code for that statement should get highlighted in the editor. However, only the indentation before the command and the semicolon after the command gets highlighted. Text generated using [self.kind.toString() /] is not linked by the traceability model.
Comment 1 Stephane Begaudeau CLA 2011-09-16 08:39:59 EDT
A fix has been contributed on HEAD with a unit test for this case, the fix will be available in Acceleo 3.2.0
Comment 2 Laurent Goubet CLA 2015-05-27 08:56:01 EDT
Closing resolved bugs