Presentation compiler not correctly updated after refactoring > move
Migrated from http://lampsvn.epfl.ch/trac/scala/ticket/2131
Reporter alex.parvulescu
Hello,
Eclipse 3.5 ; Scala 2.7.5 , Ubuntu 9.04
When I use Refactor -> Move on a class Eclipse will move the class ok, but it somehow still remains a reference to it just in the old package. I can only use the moved class in classes of the old package if I use its full name (like com.pfalabs.core.Master).
Even if I import the new class like 'import com.pfalabs.core.Master' it still tries to use the old class some how.
What is more interesting is that is holds a reference to the old version. If I update the class at some point, Eclipse will complain about non existing methods on the class that is not there any more.
To recap:
- I have a 'Master' class in the 'com.pfalabs.core' package.
- A 'Slave' class in the same package: 'com.pfalabs.core'.
- Refactor - Move the 'Master' to another package
'com.pfalabs.service'
- Add a new method to the 'Master' class. Let's call it 'newTest'
If I try to use this new method in the 'Slave' class - wich appears to use the old class, Eclipse will complain (error) about the non-existent method on 'Master'
If I try to import it by package: 'import com.pfalabs.service.Master' Eclipse will complain (only a warning) about the import hiding the real class.
The only way I can use the Master class now is to reference it by its full name like 'com.pfalabs.service.Master' wherever I define a val.
Eclipse restart doesn't seem to fix this
thanks
Reporter alex.parvulescu
Hello,
Eclipse 3.5 ; Scala 2.7.5 , Ubuntu 9.04
When I use Refactor -> Move on a class Eclipse will move the class ok, but it somehow still remains a reference to it just in the old package. I can only use the moved class in classes of the old package if I use its full name (like com.pfalabs.core.Master).
Even if I import the new class like 'import com.pfalabs.core.Master' it still tries to use the old class some how.
What is more interesting is that is holds a reference to the old version. If I update the class at some point, Eclipse will complain about non existing methods on the class that is not there any more.
To recap:
- I have a 'Master' class in the 'com.pfalabs.core' package.
- A 'Slave' class in the same package: 'com.pfalabs.core'.
- Refactor - Move the 'Master' to another package
'com.pfalabs.service'
- Add a new method to the 'Master' class. Let's call it 'newTest'
If I try to use this new method in the 'Slave' class - wich appears to use the old class, Eclipse will complain (error) about the non-existent method on 'Master'
If I try to import it by package: 'import com.pfalabs.service.Master' Eclipse will complain (only a warning) about the import hiding the real class.
The only way I can use the Master class now is to reference it by its full name like 'com.pfalabs.service.Master' wherever I define a val.
Eclipse restart doesn't seem to fix this
thanks
Leave a comment
on 2009-07-07 10:48 *
By
Does a clean build fix it?
on 2009-07-08 17:43 *
By tracImporter
Trac author: alex.parvulescu
Replying to milessabin:
Does a clean build fix it?
Hello,
Sorry, I completely forgot about this, and it seems there is no email notification.
If what you are asking me about is clean project then yes, a project clean will fix this.
But I really thing it should work out of the box. It even fixed the import properly, and that was very nice, seeing as the 'organise imports' option doesn't seem to work.
thanks,
Alex
Replying to milessabin:
Does a clean build fix it?
Hello,
Sorry, I completely forgot about this, and it seems there is no email notification.
If what you are asking me about is clean project then yes, a project clean will fix this.
But I really thing it should work out of the box. It even fixed the import properly, and that was very nice, seeing as the 'organise imports' option doesn't seem to work.
thanks,
Alex
on 2009-07-08 18:26 *
By
Yes, of course it should work. But your telling me that a clean build makes the problem go away tells me something about what the problem actually is, and also makes me confident that work that's ongoing on trunk will solve it properly.
Updating tickets (#1000069, #1000195, #1000213, #1000223, #1000006, #1000021, #1000038, #1000048, #1000051, #1000052, #1000075, #1000103, #1000109, #1000115, #1000119, #1000156, #1000186, #1000207, #1000238, #1000262, #1000263, #380, #389, #683, #1238, #1331, #1635, #1645, #1715, #1729, #1744, #1783, #1839, #1869, #1885, #1890, #1902, #1918, #1919, #1924, #1925, #1946, #1964, #1991, #2131, #2233, #2342, #2348, #2408, #2459, #2499, #2523, #2572, #2582, #2602, #2614, #2615, #2675, #2710, #2745, #2763, #2816, #2830, #2834, #2878, #2879, #2887, #2888, #2901, #2911, #2912, #2922, #2937, #2938, #2942, #2951, #2955, #2957, #2961, #2964, #2965, #2974, #2975, #2989, #2990, #3002, #3055, #3070, #3087, #3135, #3139, #3173, #3182, #3184, #3200, #3213, #3214, #3221, #3243, #3251)
on 2011-03-24 18:18 *
By Iulian Dragos
Updating tickets (#1000199, #1000200, #1000201, #1000204, #1000205, #1000209, #1000210, #1000211, #1000212, #1000215, #1000217, #1000218, #1000220, #1000222, #1000226, #1000227, #1000228, #1000230, #1000231, #1000232, #1000233, #1000235, #1000236, #1000237, #1000239, #1000240, #1000241, #1000242, #1000243, #1000244, #1000248, #1000249, #1000252, #1000253, #1000254, #1000255, #1000256, #1000258, #1000259, #1000032, #1000059, #1000062, #1000163, #1000197, #1000216, #1000221, #1000224, #1000121, #1000175, #1000219, #1000251, #1000069, #1000195, #1000213, #1000223, #1000006, #1000021, #1000038, #1000048, #1000051, #1000052, #1000075, #1000103, #1000109, #1000115, #1000119, #1000156, #1000186, #1000207, #1000238, #1000262, #1000263, #380, #389, #683, #1238, #1331, #1635, #1645, #1715, #1729, #1744, #1783, #1839, #1869, #1885, #1890, #1902, #1918, #1919, #1924, #1925, #1946, #1964, #1991, #2131, #2233, #2342, #2348, #2408)
on 2012-01-23 15:06 *
By skyluc
Version set to 2.0.0-final-29
Eclipse version set to All
Assigned to changed from login to -none-
Component changed from None to Refactoring
Permission type changed from None to Public
Summary changed from Refactor -> Move error in Eclipse 3.5 to Presentation compiler not correctly updated after refactoring > move
Status changed from New to Accepted
The code compiles without problem, but the editor reports squiggly errors.
It looks like that the presentation compiler is not aware that the file has moved and it doesn't see the changes until a clean build is performed.
It looks like that the presentation compiler is not aware that the file has moved and it doesn't see the changes until a clean build is performed.
This seems to be fixed now that the Scala Move refactoring participates in Eclipse's move actions.