| Summary: | error markers inconsistent on saving file | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Dietmar Stoll <btickets> | ||||||||||||
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> | ||||||||||||
| Status: | CLOSED WORKSFORME | QA Contact: | |||||||||||||
| Severity: | normal | ||||||||||||||
| Priority: | P3 | CC: | christoph.gutmann, ed, knut.wannheden, serano, sven.efftinge, work.mra | ||||||||||||
| Version: | 2.3.1 | Flags: | sven.efftinge:
kepler+
|
||||||||||||
| Target Milestone: | M7 | ||||||||||||||
| Hardware: | PC | ||||||||||||||
| OS: | All | ||||||||||||||
| Whiteboard: | |||||||||||||||
| Attachments: |
|
||||||||||||||
Created attachment 228070 [details]
Screenshot after step 1
Created attachment 228071 [details]
Screenshot after step 2
Created attachment 228072 [details]
Screenshot after step 3
Created attachment 228073 [details]
Screenshot after step 4
Possibly duplicates Bug 367777. The problem may be as simple as "Save" erases Expensive Validation warnings from the Problems View. By default Xtext only reparses/-validates files if referenced names have changed.
In the described scenario you are expecting a change although the referenceable elements haven't changed but just an "implementation detail".
I'd suggest you rethink your language design. If that's not possible you need to register a specialized ResourceDescriptionStrategy which
creates EObjectDescriptions with some special user data (e.g. the referenceables in text form).
This is a prototype using current time millis:
class DescStrategy extends DefaultResourceDescriptionStrategy {
@Override
public boolean createEObjectDescriptions(EObject eObject,
final IAcceptor<IEObjectDescription> acceptor) {
return super.createEObjectDescriptions(eObject, new IAcceptor<IEObjectDescription>() {
@Override
public void accept(IEObjectDescription t) {
acceptor.accept(EObjectDescription.create(t.getQualifiedName(), t.getEObjectOrProxy(),
Collections.singletonMap("hash", ""+System.currentTimeMillis())));
}
});
}
}
Although I haven't inspected your code, you may also want to take a look at how the XbaseResourceDescriptionStrategy works. It computes a "fingerprint" for exported objects. This will make sure that referencing resources are rebuilt as required. Requested via bug 522520. -M. Requested via bug 522520. -M. |
Created attachment 228069 [details] Sample Eclipse Project, Sample DSL file, Screenshots Steps to reproduce: The attached file contains a sample DSL project, sample DSL files and screenshots. Import the attached projects in the Eclipse Workspace, create the Xtext artifacts, start the runtime Workbench and import the sample project in the attached file. Step 1 (screenshot step-1.png): open a.mydsl, b.mydsl (and optionally c.mydsl), clean project a validation error is shown in the editor, problems view, project explorer Step 2 (screenshot step-2.png): change refernce in b.mydsl, save UNEXPECTED: validation error stays, shown in editor (grey), problems view, project explorer Step 3 (screenshot step-3.png): make a.mydsl dirty and save it all error markers disappear Step 4 (screenshot step-4.png): change reference in b.mydsl, save UNEXPECTED: validation error shown only in the editor The behavior after step 2 and step 4 is unexpected.