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

Bug 363559

Summary: [refactoring] Refactoring doesn't work out of the box for JVM langauges
Product: [Modeling] TMF Reporter: Jan Koehnlein <jan>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 Flags: jan: juno+
Version: 2.1.0   
Target Milestone: M4   
Hardware: All   
OS: All   
Whiteboard:

Description Jan Koehnlein CLA 2011-11-11 03:34:13 EST
If you create a JVM language as described in the tutorial refactoring does not really work. We should fix this to lower the barrier for newbies.
Comment 1 Jan Koehnlein CLA 2011-11-11 04:51:19 EST
Three issues had to be fixed
1) The RefactorElementNameFragment has to be executed before the XbaseGeneratorFragment as the latter overrides some bindings
2) The RefactorElementNameFragment needed useJdtRefactoring=true to work
3) The generated IRenameStrategy overrode setInferredJvmElementName() without calling super. 

Fixes:
1) Changed the default workflow. 
2) The RefactorElementNameFragment by default uses the JDT refactoring if the grammar extends Xbase. You can override this with the useJdtRefactoring property. 
3) We no longer generate an IRenameStrategy but bind a DefaultJvmModelRenameStrategy which should work fine in most cases. 

Migration hints:
1) Old workflows will fail as I introduced a final binding in the XbaseGeneratorFragment. I hope this is enough to lead users to move their RefactorElementNameFragment before the XbaseGeneratorFragment. 
2) Should work OOTB.
3) The super class AbstractJvmModelRenameStrategy has been deprecated, yielding a warning in the generated RenameStrategy. Deprecation warning tells the user his class is no longer being used.
Comment 2 Karsten Thoms CLA 2017-09-19 17:57:58 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 18:08:46 EDT
Closing all bugs that were set to RESOLVED before Neon.0