From 01a6ce930efae4bfc85e008959379ed9fd6ee538 Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Mon, 23 May 2016 17:42:59 +0300 Subject: [PATCH] Don't request write action for ReplaceExplicitFunctionLiteralParamWithItIntention because it's based on refactoring (KT-12436) Workaround for exception: Refactorings should not be started inside write action because they start progress inside and any read action from the progress task would cause the deadlock #KT-12436 Fixed --- .../ReplaceExplicitFunctionLiteralParamWithItIntention.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/ReplaceExplicitFunctionLiteralParamWithItIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/ReplaceExplicitFunctionLiteralParamWithItIntention.kt index 980f18e43ef..c77218f0ba3 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/ReplaceExplicitFunctionLiteralParamWithItIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/ReplaceExplicitFunctionLiteralParamWithItIntention.kt @@ -58,6 +58,8 @@ class ReplaceExplicitFunctionLiteralParamWithItIntention() : PsiElementBaseInten return true } + override fun startInWriteAction(): Boolean = false + override fun invoke(project: Project, editor: Editor, element: PsiElement) { val caretOffset = editor.caretModel.offset val functionLiteral = targetFunctionLiteral(element, editor.caretModel.offset)!!