The folder structure for my source is like this:
where all my source is under src, and all my units tests are in corresponding packages under test.
I was trying to move a package to another location. For example, I was trying to move "mypackage" from under com.company.package1 to under com.company.package2.
When I tried this, it said it couldn't do it (as documented in the Help - http://www.intellij.com/docs/help/refactoring/movePackage.html, bottom of the page), because the package was "spread" through several folders.
Is there a logical reason why this refactoring cannot be performed? Or is it just something which IDEA doesn't support at the moment?
In this case, I want to move the packages under both root directories. In other cases, I might want to only move the package under one root. Is this logically possible? (This would presumably be more work, as you'd have to change only some of the references to the package).
And what can I practically do in IDEA as it currently in the current (EAP) version to actually achieve this refactoring?
The other more minor point about this error dialog is that it only comes up after you've entered the new parent package, rather than telling you immediately.
For renaming packages, a similar restriction applies, though less stringent (see http://www.intellij.com/docs/help/refactoring/renamePackage.html, bottom of page). In this case, it might also be nice to be able to choose which parts of the package (i.e. under which root directories) get renamed.