From 2a684684a5a0f4fd9957d870665424c7c68bc447 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 20 Apr 2018 13:05:24 +0200 Subject: [PATCH] Pass canChangeWhitespaceOnly flag in reformat inspection Otherwise IDEA will run preformat and postformat processors, which don't expect to run outside of EDT (IDEA-185991) --- .../kotlin/idea/formatter/CollectChangesWithoutApplyModel.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/formatter/CollectChangesWithoutApplyModel.kt b/idea/src/org/jetbrains/kotlin/idea/formatter/CollectChangesWithoutApplyModel.kt index a4c5c3d53bd..bb1441c6bf8 100644 --- a/idea/src/org/jetbrains/kotlin/idea/formatter/CollectChangesWithoutApplyModel.kt +++ b/idea/src/org/jetbrains/kotlin/idea/formatter/CollectChangesWithoutApplyModel.kt @@ -1,5 +1,5 @@ /* - * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the license/LICENSE.txt file. */ @@ -41,7 +41,7 @@ sealed class FormattingChange { fun collectFormattingChanges(file: PsiFile): Set { try { file.collectFormattingChanges = true - CodeStyleManager.getInstance(file.project).reformat(file) + CodeStyleManager.getInstance(file.project).reformat(file, true) return file.collectChangesFormattingModel?.requestedChanges ?: emptySet() } finally {