update moved files references

This commit is contained in:
anna
2010-08-10 10:26:38 +04:00
parent 03252dea74
commit 949f0d69e5
@@ -122,13 +122,15 @@ public class MoveFilesOrDirectoriesProcessor extends BaseRefactoringProcessor {
}
else if (element instanceof PsiFile) {
final PsiFile movedFile = (PsiFile)element;
MoveFileHandler.forElement(movedFile).prepareMovedFile(movedFile, myNewParent, oldToNewMap);
FileReferenceContextUtil.encodeFileReferences(element);
MoveFileHandler.forElement(movedFile).prepareMovedFile(movedFile, myNewParent, oldToNewMap);
if (myNewParent.findFile(movedFile.getName()) == null) {
PsiFile moving = myNewParent.findFile(movedFile.getName());
if (moving == null) {
MoveFilesOrDirectoriesUtil.doMoveFile(movedFile, myNewParent);
}
movedFiles.add(movedFile);
moving = myNewParent.findFile(movedFile.getName());
movedFiles.add(moving);
}
getTransaction().getElementListener(element).elementMoved(element);