IJPL-167274 Add extension point for disabling essential analysis mode restart per project

(cherry picked from commit 35e52cb683d3d990ba74494dea8a537199942d35)

IJ-CR-149829

GitOrigin-RevId: 64f6b75247d7f2e0889c998bfb730ac0d9fa5993
This commit is contained in:
Błażej Kardyś
2024-11-18 18:32:20 +01:00
committed by intellij-monorepo-bot
parent 6558ffdac9
commit f4cf3566bf
4 changed files with 29 additions and 1 deletions

View File

@@ -2249,6 +2249,10 @@ f:com.intellij.codeInsight.daemon.impl.ErrorStripeUpdateManager
- f:repaintErrorStripePanel(com.intellij.openapi.editor.Editor,com.intellij.psi.PsiFile):V
f:com.intellij.codeInsight.daemon.impl.ErrorStripeUpdateManager$Companion
- f:getInstance(com.intellij.openapi.project.Project):com.intellij.codeInsight.daemon.impl.ErrorStripeUpdateManager
com.intellij.codeInsight.daemon.impl.EssentialHighlightingRestarterDisablement
- sf:EP_NAME:com.intellij.openapi.extensions.ExtensionPointName
- s:isEssentialHighlightingRestarterDisabledForProject(com.intellij.openapi.project.Project):Z
- a:shouldBeDisabledForProject(com.intellij.openapi.project.Project):Z
c:com.intellij.codeInsight.daemon.impl.GotoNextErrorHandler
- com.intellij.codeInsight.CodeInsightActionHandler
- <init>(Z):V

View File

@@ -32,7 +32,8 @@ public final class EssentialHighlightingRestarter implements SaveAndSyncHandlerL
@Override
public void beforeSave(@NotNull SaveAndSyncHandler.SaveTask task, boolean forceExecuteImmediately) {
if (!Registry.is("highlighting.essential.should.restart.in.full.mode.on.save.all")) {
if (!Registry.is("highlighting.essential.should.restart.in.full.mode.on.save.all")
|| EssentialHighlightingRestarterDisablement.isEssentialHighlightingRestarterDisabledForProject(myProject)) {
return;
}
boolean hasFilesWithEssentialHighlightingConfigured =

View File

@@ -0,0 +1,22 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.codeInsight.daemon.impl;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.project.Project;
/**
* Disables essential highlighting restart on save on a project basis
*/
public interface EssentialHighlightingRestarterDisablement {
ExtensionPointName<EssentialHighlightingRestarterDisablement> EP_NAME = ExtensionPointName.create("com.intellij.daemon.essentialHighlightingRestarterDisablement");
boolean shouldBeDisabledForProject(Project project);
static boolean isEssentialHighlightingRestarterDisabledForProject(Project project) {
return EP_NAME.getExtensionList().stream()
.map(extension -> extension.shouldBeDisabledForProject(project))
.reduce(Boolean::logicalOr)
.orElse(false);
}
}

View File

@@ -65,6 +65,7 @@
</extensionPoint>
<extensionPoint name="daemon.highlightInfoFilter" interface="com.intellij.codeInsight.daemon.impl.HighlightInfoFilter" dynamic="true"/>
<extensionPoint name="daemon.essentialHighlightingRestarterDisablement" interface="com.intellij.codeInsight.daemon.impl.EssentialHighlightingRestarterDisablement" dynamic="true"/>
<extensionPoint name="daemon.tooltipActionProvider" interface="com.intellij.codeInsight.daemon.impl.tooltips.TooltipActionProvider" dynamic="true"/>
<extensionPoint name="daemon.intentionActionFilter" interface="com.intellij.codeInsight.daemon.impl.IntentionActionFilter" dynamic="true"/>
<extensionPoint name="daemon.externalAnnotatorsFilter" interface="com.intellij.lang.ExternalAnnotatorsFilter" dynamic="true"/>