Do not use methods which may show UI dialog in write action in refactorings
#KT-33082 fixed
This commit is contained in:
@@ -327,7 +327,7 @@ fun <T> chooseContainerElement(
|
||||
toPsi: (T) -> PsiElement,
|
||||
onSelect: (T) -> Unit
|
||||
) {
|
||||
return getPsiElementPopup(
|
||||
val popup = getPsiElementPopup(
|
||||
editor,
|
||||
containers,
|
||||
object : PsiElementListCellRenderer<PsiElement>() {
|
||||
@@ -392,7 +392,10 @@ fun <T> chooseContainerElement(
|
||||
onSelect(it)
|
||||
true
|
||||
}
|
||||
).showInBestPositionFor(editor)
|
||||
)
|
||||
ApplicationManager.getApplication().invokeLater {
|
||||
popup.showInBestPositionFor(editor)
|
||||
}
|
||||
}
|
||||
|
||||
fun <T> chooseContainerElementIfNecessary(
|
||||
|
||||
@@ -57,7 +57,7 @@ fun invokeMoveFilesOrDirectoriesRefactoring(
|
||||
val elementsToMove = elements
|
||||
.filterNot {
|
||||
it is PsiFile
|
||||
&& runWriteAction { CopyFilesOrDirectoriesHandler.checkFileExist(selectedDir, choice, it, it.name, "Move") }
|
||||
&& CopyFilesOrDirectoriesHandler.checkFileExist(selectedDir, choice, it, it.name, "Move")
|
||||
}
|
||||
.sortedWith( // process Kotlin files first so that light classes are updated before changing references in Java files
|
||||
java.util.Comparator { o1, o2 ->
|
||||
|
||||
Reference in New Issue
Block a user