Fixing the move refactoring

Today I did a larger refactoring of my code base, which included many splitting of files with multiple entities and moving stuff to other packages.

I must say that Idea fails miserably in helping me in this task. I'm not sure whether there are situations in which moving an entity or a file to a different package works without manually fixing imports and package declarations. At the very least, moving fails very often.

Maybe I'm doing things the wrong way. As Scala doesn't require the package declaration to match the file location and stuff. If if should be working as intended, I'd like to know how am I supposed to move my stuff around.

There are some open tickets about this. And as this seems like an important feature I am wondering about when this problem will get some attention. Scala's move refactoring is definately more complicated than Java's with multiple entities inside the same file, more complicated import statements and the removal of the need to have package and file location coherent.

To sum it up:

1. Is the move refactoring supposed to be working in general?
2. Am I doing it wrong? How do I move my stuff and have imports changed automatically?
3. Is there any work planned in the move refactoring?

3
34 comments

Comments and imports are being deleted!

I just submitted this issue: https://youtrack.jetbrains.com/issue/IDEA-205143 (wasn't sure whether to submit it under "IntelliJ IDEA" or "Scala" - I went for the first)

0

It's June 2019, and move in Scala still doesn't work. Jetbrains, this is no longer funny

1

Just tried move refactoring with scala for the first time. It happened... exactly nothing. No error message, nothing.

0

Ok this thread started in 2011.  9 years ago!!!  Moving scala classes to a different package breaks existing imports which must then be fixed up manually. JetBrains???  JETBRAINS??????

1

Please sign in to leave a comment.