| Summary: | [dot4zest] Do not call DotStandaloneSetup.doSetup in Eclipse environment | ||
|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Sebastian Zarnekow <sebastian.zarnekow> |
| Component: | GEF DOT | Assignee: | gef-inbox <gef-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | nyssen, steeg, zoltan.ujhelyi |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Sebastian Zarnekow
Yes, the call is actually there. What is the problem and how to do it right? The problem is that Xtext has different binding for Eclipse and non-Eclipse environments, and using the non-Eclipse binding, started by the StandaloneSetup.doSetup method causes all kinds of issues runtime (e.g. in the EMF-IncQuery project we had some hard-to-understand classcastexceptions related to it). The right way to do it is not to call the StandaloneSetup inside the API, but rely on the language being already registered. For Eclipse environments, this is done via extension points of the UI project of the language; for Eclipse-less environments the StandaloneSetup needs to be called once per application. I am not sure about the concrete use case here, but I assume we may then simply guard the call with something like (if(!Eclipse.isRunning()){}...
Or you could check whether there's already a resource factory registered for your file extension. This would help to execute the standalone setup only once Attempted fix based on Sebastian's suggestion from comment #4: http://git.eclipse.org/c/gef/org.eclipse.gef4.git/commit/?id=5de17cfa689decba (In reply to Fabian Steeg from comment #5) > Attempted fix based on Sebastian's suggestion from comment #4: > http://git.eclipse.org/c/gef/org.eclipse.gef4.git/commit/?id=5de17cfa689decba Is there a nightly build or an update site that can be consumed to test drive the fix? (In reply to Sebastian Zarnekow from comment #6) > (In reply to Fabian Steeg from comment #5) > > Attempted fix based on Sebastian's suggestion from comment #4: > > http://git.eclipse.org/c/gef/org.eclipse.gef4.git/commit/?id=5de17cfa689decba > > Is there a nightly build or an update site that can be consumed to test > drive the fix? Yes, it's included on https://hudson.eclipse.org/hudson/job/gef4-master/lastSuccessfulBuild/artifact/update-site Sebastian, may we resolve this one as fixed? Yes, I think so. |