From 49ce77ebcb085e4f4b66f37bc3f2add1a3e0ca0c Mon Sep 17 00:00:00 2001 From: Piotr Tomiak Date: Sat, 4 Oct 2025 14:17:11 +0200 Subject: [PATCH] [vcs] IJI-3089 Allow contributing new inspections for the commit message editor through extension points. GitOrigin-RevId: c9297f895bbc7d7200f250298d29673cd0358e31 --- .../resources/META-INF/VcsExtensionPoints.xml | 4 ++++ .../vcs-impl/resources/META-INF/VcsExtensions.xml | 5 +++++ .../message/CommitMessageInspectionProfile.java | 14 +++++++------- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/platform/vcs-impl/resources/META-INF/VcsExtensionPoints.xml b/platform/vcs-impl/resources/META-INF/VcsExtensionPoints.xml index 63e29ea9716f..b5e3635071c8 100644 --- a/platform/vcs-impl/resources/META-INF/VcsExtensionPoints.xml +++ b/platform/vcs-impl/resources/META-INF/VcsExtensionPoints.xml @@ -263,6 +263,10 @@ interface="com.intellij.openapi.vcs.VcsFileListenerIgnoredFilesProvider" dynamic="true"/> + + diff --git a/platform/vcs-impl/resources/META-INF/VcsExtensions.xml b/platform/vcs-impl/resources/META-INF/VcsExtensions.xml index b10a324993a9..502d32e171b7 100644 --- a/platform/vcs-impl/resources/META-INF/VcsExtensions.xml +++ b/platform/vcs-impl/resources/META-INF/VcsExtensions.xml @@ -134,6 +134,11 @@ + + + + + { + @ApiStatus.Internal + @ApiStatus.Experimental + public static final ExtensionPointName EP_NAME = ExtensionPointName.create("com.intellij.vcs.commitMessageInspection"); + public static final @NotNull Topic TOPIC = Topic.create("commit message inspection changes", ProfileListener.class); private static final String PROFILE_NAME = "Commit Dialog"; // NON-NLS @@ -131,12 +136,7 @@ public class CommitMessageInspectionProfile extends InspectionProfileImpl private static class CommitMessageInspectionToolSupplier extends InspectionToolsSupplier { @Override public @NotNull List> createTools() { - return Arrays.asList( - new LocalInspectionToolWrapper(new SubjectBodySeparationInspection()), - new LocalInspectionToolWrapper(new SubjectLimitInspection()), - new LocalInspectionToolWrapper(new BodyLimitInspection()), - new LocalInspectionToolWrapper(new CommitMessageSpellCheckingInspection()) - ); + return ContainerUtil.map(EP_NAME.getExtensionList(), it -> new LocalInspectionToolWrapper(it)); } }