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

Bug 364508

Summary: Xbase QualifiedNameProvider implementation ignores ValidID-definition
Product: [Modeling] TMF Reporter: Alexander Nittka <alex>
Component: XtextAssignee: Holger Schill <Holger.Schill>
Status: CLOSED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: btickets, Holger.Schill, sebastian.zarnekow, sven.efftinge
Version: 2.1.0Flags: sebastian.zarnekow: juno+
Target Milestone: M5   
Hardware: All   
OS: All   
Whiteboard:

Description Alexander Nittka CLA 2011-11-22 14:47:18 EST
In the first iteration this is a question rather than a bug report. Take the domainmodel example and override the ValidID - adding a keyword to be allowed in a valid Id - rule to:

ValidID:ID|"op";

Name the package in a sample model file op.mypackage

The result is that the name (i.e. the string stored in the name feature) of the package is indeed only "mypackage" (see outline view and index etc.) The reason is that the QualifiedNameValueConverter in its toValue-method iterates only over the *leaf nodes*. So although the value converter for ValidID might already be correct or is overridden to be correct, it is not used at all in the QualifiedNameValueConverter.
The leafs will be ID and Keyword, but a keyword cannot even be processed by a delegate rule call, so the QualifiedNameValueConverter would have to be "reimplemented".

Question: is this intended or is it a bug? My impression from the grammar design is that the point of the ValidID rule is being able to change what an ID may look like without touching the QualifiedNameRule (and hence not touch its value converter) at all. I would understand having to modify the QualifiedNameValueConverter if I actually change the QualifiedName rule...
Comment 1 Sebastian Zarnekow CLA 2011-11-22 15:09:18 EST
It's a bug.
Reproducable with Xtend and the package com.foo.create
Comment 2 Holger Schill CLA 2012-01-06 08:23:55 EST
Introduced XbaseQualifiedNameValueConverter to deal with the ValidIds.

pushed tests and fix to MASTER.
Comment 3 Karsten Thoms CLA 2017-09-19 18:05:06 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 4 Karsten Thoms CLA 2017-09-19 18:15:04 EDT
Closing all bugs that were set to RESOLVED before Neon.0