Community
Participate
Working Groups
I wanted to implement "Run as Java application" (and "Debug") context menu, for my Xbase language, I had a look at plugin.xml of xtend.ide project... from what I understand, it is enough to have these adapter extension points <extension point="org.eclipse.core.runtime.adapters"> <factory class="org.eclipse.xtend.ide.XtendExecutableExtensionFactory:org.eclipse.xtext.xbase.ui.launching.JavaElementDelegateAdapterFactory" adaptableType="org.eclipse.ui.IFileEditorInput"> <adapter type="org.eclipse.xtext.xbase.ui.launching.JavaElementDelegateMainLaunch"/> </factory> <factory class="org.eclipse.xtend.ide.XtendExecutableExtensionFactory:org.eclipse.xtext.xbase.ui.launching.JavaElementDelegateAdapterFactory" adaptableType="org.eclipse.ui.IEditorPart"> <adapter type="org.eclipse.xtext.xbase.ui.launching.JavaElementDelegateMainLaunch"/> </factory> ... after replacing the XtendExecutableExtensionFactory with my DSL ExecutableExtensionFactory... I tried that in the runtime Eclipse instance and it works like a charm! But it breaks this feature for Xtend files... see also https://www.eclipse.org/forums/index.php/t/940431/
an additional symptom that something is wrong is that the "Run as Java application" for my DSL works only if also xtend.ide bundle is part of the target platform (although I'm only using xbase bundles)...
Hi Lorenzo, Did you have a look here? https://github.com/xtext-dev/seven-languages-xtext/blob/master/languages/org.xtext.builddsl.ui/plugin.xml Cheers, Holger
Hi Holger I noted that the builddsl had special launches, but I thought that what Xtend does could be reused; while you're saying this is not the case and that I should implement a custom launch similar to what builddsl does? cheers Lorenzo
Actually adding the adapters doesn't seem to work anymore... any clue please on how to reuse this xbase launching feature without having to reimplement everything? Why does it work with Xtend but not with other Xbase languages?
are you sure it is not working. are you sure you did customize the adapter config to be conflict free?
besides that can you please debug?
p.s. did you follow https://www.eclipse.org/forums/index.php?t=msg&th=1086005&goto=1761050& ?
I think the solution proposed in the forum is the way to go, I'll try that ASAP. But I also think that's a bug, probably in Xbase (and the way Xtend uses it), much similar to https://bugs.eclipse.org/bugs/show_bug.cgi?id=471773
I confirm that the solution in the forum works!