Community
Participate
Working Groups
Created attachment 248352 [details] Example of "Run As" menu on .project file 1 The org.eclipse.xtend.ide plugin contains launch shortcuts which provide the "Run As > Java Application" (and similar) menu entries for xtend/xbase files (in theory). 2 These contributions are properly guarded by enablement expressions which make them invisible for selections where they don't make sense. 3 However, when the org.eclipse.xtend.ide plugin is not started, these enablement expression evaluate to NOT_LOADED (because the adapt expression inside them returns NOT_LOADED) and org.eclipse.debug.ui optimistically adds them to the menu of *each* file in xtext based projects. 4 As soon as the org.eclipse.xtend.ide plugin is started, the menu entries disappear, because now the adapt expression can be evaluated and returns false As a result, *each and every* file in the xtext based project has now three extra context menus "Run As -> Java Application" "Run As JUnit Plug-in Test" "Run As JUnit Test" This is at least confusing, and adds extra issues for "stupid" customers not really knowing what they can actually "Run". I think playing around with the order of constraints and adding somewhere on xtend related contribution "forcePluginActivation=true" should fix the issue.
The xtend.ide plugin is expensive to enable. That wouldn't an option, though we could factor the xml stuff into an own bundle.
(In reply to Sebastian Zarnekow from comment #1) > The xtend.ide plugin is expensive to enable. That wouldn't an option, though > we could factor the xml stuff into an own bundle. OK, I see. Just curious: why is there no file filter added? Isn't this intended to be used only for .xtend files?
You could also create your own JVM language with Xbase and you'd get Run As... support automatically, if a main method is inferred.