Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 393885

Summary: [debugger] Install source information into bytecode (replace references to Java)
Product: [Tools] Xtend Reporter: Sven Efftinge <sven.efftinge>
Component: CoreAssignee: Project Inbox <xtend-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: alex.tugarev, moritz.eysholdt
Version: 2.4.0Flags: sven.efftinge: kepler+
Target Milestone: M4   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:
Bug Depends on:    
Bug Blocks: 384062, 387677    

Description Sven Efftinge CLA 2012-11-08 10:25:49 EST
In addition and as an alternative for platforms where JSR-45 doesn't work properly, there should be a compiler preference, which installs the debug information replacing the information about Java.
Comment 1 Moritz Eysholdt CLA 2012-11-28 09:50:55 EST
I've pushed a first version to 'master':
http://git.eclipse.org/c/tmf/org.eclipse.xtext.git/commit/?id=68b9c11258816778bcc88e0bea0cab7c7b82a49e

In the compiler preferences for a specific output folder, you'll find a checkbox named "Use DSL files only (and not Java files) as sources for debugging". You'll need to enable this to test this feature.

If enabled, Xtext uses the ASM bytecode manipulation library to replace the SourceFile and LineNumberTable attributes in the java class file. These attributes then point to the DSL files instead of the Java file. 

These is one remaining problem: The Eclipse Debugger opens the Java File form the bin folder instead of the one from the source folder. This seems to be because JDT copies .xtend files to the bin folder and the bin folder is earlier on the search path. For SMAP support, this was "fixed" by using a project-relative file name. Th however, doesn't seem to be supported by the Eclipse Debugger for the primary source files.
Comment 2 Moritz Eysholdt CLA 2012-11-28 09:53:09 EST
Correction: There is one remaining problem: The Eclipse Debugger opens the XTEND File form the...
Comment 3 Moritz Eysholdt CLA 2012-11-28 10:24:47 EST
workaround: go to project preferences -> Java -> Compiler -> Building -> OutputFolder -> and add "*.xtend" to the list of filtered resources. 

Maybe we should do this automatically for Xtend projects. The configuration is programmatically accessible via org.eclipse.jdt.core.JavaCore.CORE_JAVA_BUILD_RESOURCE_COPY_FILTER.
Comment 4 Moritz Eysholdt CLA 2012-11-29 07:40:44 EST
Now, *.xtend is added to the JDT Builder Resource Copy Filter when the Xtend constructor is created. See http://git.eclipse.org/c/xtend/org.eclipse.xtend.git/commit/?id=8ceaceffb0333d2cbb835cf52156f884321adbdf

I'm doing this via a Guice eager binding and not in the plugin activator, since our activator is in src-gen and I didn't feel like subclassing it.
Comment 5 Eclipse Webmaster CLA 2017-10-31 10:47:19 EDT
Requested via bug 522520.

-M.
Comment 6 Eclipse Webmaster CLA 2017-10-31 10:58:26 EDT
Requested via bug 522520.

-M.