Bug 457313 - Run/Debug as Java application for Xbase languages breaks Xtend corresponding launches
Summary: Run/Debug as Java application for Xbase languages breaks Xtend corresponding ...
Status: NEW
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.7.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-13 03:58 EST by Lorenzo Bettini CLA
Modified: 2019-01-05 13:12 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lorenzo Bettini CLA 2015-01-13 03:58:29 EST
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/
Comment 1 Lorenzo Bettini CLA 2015-01-13 10:33:15 EST
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)...
Comment 2 Holger Schill CLA 2015-01-14 03:44:54 EST
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
Comment 3 Lorenzo Bettini CLA 2015-01-14 07:47:21 EST
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
Comment 4 Lorenzo Bettini CLA 2019-01-05 11:25:13 EST
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?
Comment 5 Christian Dietrich CLA 2019-01-05 11:26:19 EST
are you sure it is not working.
are you sure you did customize
the adapter config to be conflict free?
Comment 6 Christian Dietrich CLA 2019-01-05 11:26:57 EST
besides that can you please debug?
Comment 7 Christian Dietrich CLA 2019-01-05 11:53:38 EST
p.s. did you follow https://www.eclipse.org/forums/index.php?t=msg&th=1086005&goto=1761050& ?
Comment 8 Lorenzo Bettini CLA 2019-01-05 12:32:51 EST
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
Comment 9 Lorenzo Bettini CLA 2019-01-05 13:12:35 EST
I confirm that the solution in the forum works!