Make copy-paste resolve task modal to avoid invalid psi elements

Due to background formatting pasted PSI elements become invalid quite soon and it is not possible to make resolve

#KT-37414 Fixed
This commit is contained in:
Vladimir Dolzhenko
2020-03-11 10:24:04 +01:00
parent 90750483ee
commit 8af5e2bb04
@@ -312,7 +312,7 @@ class KotlinCopyPasteReferenceProcessor : CopyPastePostProcessor<BasicKotlinRefe
file: KtFile,
findReferenceProvider: (indicator: ProgressIndicator) -> List<ReferenceToRestoreData>
) {
val task: Task.Backgroundable = object : Task.Backgroundable(project, "Resolve pasted references", true) {
val task = object : Task.Modal(project, "Resolving pasted references ...", true) {
override fun run(indicator: ProgressIndicator) {
assert(!ApplicationManager.getApplication().isWriteAccessAllowed) {
"Resolving references on dispatch thread leads to live lock"