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,
|
toPsi: (T) -> PsiElement,
|
||||||
onSelect: (T) -> Unit
|
onSelect: (T) -> Unit
|
||||||
) {
|
) {
|
||||||
return getPsiElementPopup(
|
val popup = getPsiElementPopup(
|
||||||
editor,
|
editor,
|
||||||
containers,
|
containers,
|
||||||
object : PsiElementListCellRenderer<PsiElement>() {
|
object : PsiElementListCellRenderer<PsiElement>() {
|
||||||
@@ -392,7 +392,10 @@ fun <T> chooseContainerElement(
|
|||||||
onSelect(it)
|
onSelect(it)
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
).showInBestPositionFor(editor)
|
)
|
||||||
|
ApplicationManager.getApplication().invokeLater {
|
||||||
|
popup.showInBestPositionFor(editor)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun <T> chooseContainerElementIfNecessary(
|
fun <T> chooseContainerElementIfNecessary(
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ fun invokeMoveFilesOrDirectoriesRefactoring(
|
|||||||
val elementsToMove = elements
|
val elementsToMove = elements
|
||||||
.filterNot {
|
.filterNot {
|
||||||
it is PsiFile
|
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
|
.sortedWith( // process Kotlin files first so that light classes are updated before changing references in Java files
|
||||||
java.util.Comparator { o1, o2 ->
|
java.util.Comparator { o1, o2 ->
|
||||||
|
|||||||
Reference in New Issue
Block a user