KT-15870: run getTargetDirectory() in write action
This commit is contained in:
committed by
Mikhail Glukhikh
parent
ee239d59aa
commit
1b2edf6a0c
+3
-1
@@ -63,7 +63,9 @@ class MoveFileToPackageMatchingDirectoryIntention : SelfTargetingOffsetIndepende
|
|||||||
Messages.showMessageDialog(project, it, CommonBundle.getErrorTitle(), Messages.getErrorIcon())
|
Messages.showMessageDialog(project, it, CommonBundle.getErrorTitle(), Messages.getErrorIcon())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
val targetDirectory = targetDirFactory.getTargetDirectory(fileToMove) ?: return
|
val targetDirectory = runWriteAction {
|
||||||
|
targetDirFactory.getTargetDirectory(fileToMove)
|
||||||
|
} ?: return
|
||||||
|
|
||||||
RefactoringMessageUtil.checkCanCreateFile(targetDirectory, file.name)?.let {
|
RefactoringMessageUtil.checkCanCreateFile(targetDirectory, file.name)?.let {
|
||||||
Messages.showMessageDialog(project, it, CommonBundle.getErrorTitle(), Messages.getErrorIcon())
|
Messages.showMessageDialog(project, it, CommonBundle.getErrorTitle(), Messages.getErrorIcon())
|
||||||
|
|||||||
Reference in New Issue
Block a user