Don't request write action for ChangeParameterTypeFix because it's based on refactoring

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
This commit is contained in:
Nikolay Krasko
2016-05-23 18:17:40 +03:00
committed by Nikolay Krasko
parent e3f85653e9
commit 98060d28a8
@@ -47,6 +47,8 @@ class ChangeParameterTypeFix(element: KtParameter, type: KotlinType) : KotlinQui
this.isPrimaryConstructorParameter = declaration is KtPrimaryConstructor
}
override fun startInWriteAction(): Boolean = false
override fun isAvailable(project: Project, editor: Editor?, file: PsiFile): Boolean {
return super.isAvailable(project, editor, file) && containingDeclarationName != null
}