Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 370135 - Rename refactoring results in fully qualified names
Summary: Rename refactoring results in fully qualified names
Status: CLOSED FIXED
Alias: None
Product: Xtend
Classification: Tools
Component: Core (show other bugs)
Version: 2.2.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: M7   Edit
Assignee: Jan Koehnlein CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 365182 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-01-30 10:11 EST by Ed Merks CLA
Modified: 2017-10-31 11:24 EDT (History)
6 users (show)

See Also:
sven.efftinge: juno+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Merks CLA 2012-01-30 10:11:38 EST
This appears to be a general problem with Xtext's support for rename refactoring. I have the same problem in Xcore as I see in Xtend... 

Consider what happens when you have two Xtend files in two different packages.

package com.example

class Foo {
}

and 

package com.example.a

import com.example.Foo

class A  extends Foo {
}

If you rename Foo to FooBar, you end with with A like this:

package com.example.a

import com.example.FooBar

class A  extends com.example.FooBar {
}

When I look at how this works in the underlying framework, the rewrites are collected for preview purposes before they are applied to the real resources or model instances.  So when the reference to FooBar is serialized in A, there is no import for it yet, i.e., the old "import com.example.Foo" doesn't help to convince the serializer to produce FooBar rather than com.example.FooBar.
Comment 1 Sven Efftinge CLA 2012-01-31 05:17:07 EST
*** Bug 365182 has been marked as a duplicate of this bug. ***
Comment 2 Jan Koehnlein CLA 2012-05-03 08:31:17 EDT
A first shot commited to MASTER.

Now writing more tests...
Comment 3 Jan Koehnlein CLA 2012-05-03 09:15:11 EDT
Pushed tests to MASTER.
Comment 4 Sebastian Zarnekow CLA 2012-05-03 09:19:15 EDT
Woohoo, nice!
Comment 5 Eclipse Webmaster CLA 2017-10-31 11:24:48 EDT
Requested via bug 522520.

-M.