From 3bed40366f3c919302d69a6b3cf2f7446f9fc666 Mon Sep 17 00:00:00 2001 From: "natalia.ponomareva" Date: Mon, 15 Jun 2026 13:44:26 +0200 Subject: [PATCH] [local]: Updated commit inspections (IJPL-245000) GitOrigin-RevId: 4adf0414b3d48d9d0826cf71dd348b9e8ee40907 --- platform/vcs-impl/api-dump.txt | 8 -------- .../intellij/vcs/commit/message/BodyLimitInspection.kt | 6 +++++- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/platform/vcs-impl/api-dump.txt b/platform/vcs-impl/api-dump.txt index 933c5a5d21a5..4494a9de3df1 100644 --- a/platform/vcs-impl/api-dump.txt +++ b/platform/vcs-impl/api-dump.txt @@ -4233,14 +4233,6 @@ pc:com.intellij.vcs.commit.message.BaseCommitMessageInspection$ReformatCommitMes - invoke(com.intellij.openapi.project.Project,com.intellij.openapi.editor.Editor,com.intellij.psi.PsiFile):V - isAvailable(com.intellij.openapi.project.Project,com.intellij.openapi.editor.Editor,com.intellij.psi.PsiFile):Z - startInWriteAction():Z -f:com.intellij.vcs.commit.message.BodyLimitInspection -- com.intellij.vcs.commit.message.BaseCommitMessageInspection -- RIGHT_MARGIN:I -- ():V -- canReformat(com.intellij.openapi.project.Project,com.intellij.openapi.editor.Document):Z -- createOptions(com.intellij.ui.dsl.builder.Panel,com.intellij.openapi.project.Project,com.intellij.openapi.Disposable):Z -- getDisplayName():java.lang.String -- reformat(com.intellij.openapi.project.Project,com.intellij.openapi.editor.Document):V c:com.intellij.vcs.commit.message.CommitMessageInspectionProfile - com.intellij.codeInspection.ex.InspectionProfileImpl - com.intellij.openapi.components.PersistentStateComponent diff --git a/platform/vcs-impl/src/com/intellij/vcs/commit/message/BodyLimitInspection.kt b/platform/vcs-impl/src/com/intellij/vcs/commit/message/BodyLimitInspection.kt index b12d6707b275..a3fdb9342796 100644 --- a/platform/vcs-impl/src/com/intellij/vcs/commit/message/BodyLimitInspection.kt +++ b/platform/vcs-impl/src/com/intellij/vcs/commit/message/BodyLimitInspection.kt @@ -21,7 +21,7 @@ import com.intellij.ui.dsl.builder.bindSelected import com.intellij.util.DocumentUtil import org.jetbrains.annotations.Nls -class BodyLimitInspection : BaseCommitMessageInspection() { +internal class BodyLimitInspection : BaseCommitMessageInspection() { @JvmField var RIGHT_MARGIN: Int = 72 @@ -47,6 +47,10 @@ class BodyLimitInspection : BaseCommitMessageInspection() { return false } + // checkFile() inspects lines by absolute number, so an edit on any line can affect the warning on another. + // Running for the whole file re-checks all lines on every change, so the warning shows/updates immediately. + override fun runForWholeFile(): Boolean = true + override fun checkFile(file: PsiFile, document: Document, manager: InspectionManager, isOnTheFly: Boolean): Array? { val lines = 1 until document.getLineCount() return lines.mapNotNull { line ->