| Summary: | Make dependency to JDT optional | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Sebastian Zarnekow <sebastian.zarnekow> | ||||||
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> | ||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | Holger.Schill, sven.efftinge | ||||||
| Version: | 0.7.0 | Keywords: | helpwanted | ||||||
| Target Milestone: | M7 | Flags: | sebastian.zarnekow:
helios+
|
||||||
| Hardware: | PC | ||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Sebastian Zarnekow
I've resolved the mentioned issue with IStorage2UriMapper. Someone should actually test what other problems occur when running Xtext without JDT. The SharedStateModule will always return an implementation of the JavaProjectsState.
public Provider<? extends IAllContainersState> provideIAllContainersState() {
return Access.provider(JavaProjectsState.class);
}
It should return an implementation that is bound in the SharedModule or SharedModuleWithJDT respectively.
Due to https://bugs.eclipse.org/bugs/show_bug.cgi?id=309631 the last mentioned point is no problem any more. org.eclipse.emf.mwe2.language.ui has a non optional dependency to org.eclipse.jdt.ui. There is only on implementation for org.eclipse.xtext.ui.editor.model.JavaClassPathResourceForIEditorInputFactory -> org.eclipse.xtext.ui.editor.model.JavaClassPathResourceForIEditorInputFactory. The implementation has a dependency to JDT. We have to provide another implementation that is JDT independent. Sorry i ment there is only one implemention for org.eclipse.xtext.ui.editor.model.IResourceForEditorInputFactory on course. The org.eclipse.xtext.ui.resource.XtextResourceSetProvider as only implementation of org.eclipse.xtext.ui.resource.IResourceSetProvider has a dependency to JDT. Created attachment 166603 [details]
Patch to make dependency to JDT optional
I made the dependency to JDT optional by implementing some JDT independent variants of the above mentioned classes. By the way I made the generated ProjectCreator JDT independent and I refactored the class EclipseResourceUtil in that way that we do not have static methods any more. I introduced some new classes to get rid of the tons of parameters in the invokement of projectcreation.
Created attachment 166607 [details]
Patch to make dependency to JDT optional
One thing on using google Guice wasn't clear to me. If you define a Provider for a class but don't use it, the class is instancetiated anyway. This caused an unment dependency to JDT. So here the patched patch. ;-)
I'll review the patch. Comment on attachment 166607 [details]
Patch to make dependency to JDT optional
I restructured the code to remove some static dependencies and unnecessary complexity.
Fixed in HEAD. Thanks for the initial patch, Holger. Major changes I made befor applying the patch: - Refactor the ProjectDescriptionCreator to a ProjectFactory hierarchy with JavaProjectFactory and PluginProjectFactory - Extracted some common parts from JavaClassPathResourceForIEditorInputFactory and ResourceForIEditorInputFactory Closing bug which were set to RESOLVED before Eclipse Neon.0. |