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

Bug 324638

Summary: [xtext] change in grammar does not trigger build of extending grammars
Product: [Modeling] TMF Reporter: Knut Wannheden <knut.wannheden>
Component: Xtext BacklogAssignee: Project Inbox <tmf.xtext-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: sebastian.zarnekow, sven.efftinge
Version: 1.0.0Flags: sebastian.zarnekow: indigo+
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Knut Wannheden CLA 2010-09-07 06:30:24 EDT
Consider the example with a grammar B declaring grammar A as a used grammar (i.e. "grammar B with A"). A change made in grammar A should cause the builder to rebuild grammar B. This does currently not happen.

An analysis shows that this is due to two separate problems:

1. When DefaultResourceDescriptionManager#isAffected() is called with B.xtext as a candidate the computed outgoingReferences contains a classpath URI for grammar A, whereas the delta pertains to A.xtext as a platform:/resource URI. Consequently there is no direct match causing B.xtext to be considered affected.

2. In a second attempt DefaultResourceDescriptionManager#isAffected() notices that A.xtext is visible to B.xtext and tries to match up the exported and imported names. This fails again because the imported names of B.xtext have not been set. This in turn is due to the fact that the XtextLinkingService does not use the ScopeProvider to establish the Grammar.usedGrammar link.
Comment 1 Sven Efftinge CLA 2010-09-07 16:38:05 EDT
Yes, we really should switch to platform:/resource URIs and make use of the builder infrastructure, etc.
Comment 2 Sebastian Zarnekow CLA 2010-10-04 04:48:13 EDT
see comment #2
Comment 3 Sebastian Zarnekow CLA 2010-10-04 04:48:38 EDT
(In reply to comment #2)
> see comment #2

actually I tried to refer to comment #1
Comment 4 Sebastian Zarnekow CLA 2010-12-13 17:21:27 EST
The cheap solution would be to override #isAffected for xtext grammars.
Comment 5 Sebastian Zarnekow CLA 2011-11-10 08:28:23 EST
Grammars are not listen for changed ecore packages either (no imported names for the package URI)