diff --git a/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/TextEditorHighlightingPassRegistrarImpl.java b/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/TextEditorHighlightingPassRegistrarImpl.java index d16d15f598b2..7ef23902a7dd 100644 --- a/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/TextEditorHighlightingPassRegistrarImpl.java +++ b/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/TextEditorHighlightingPassRegistrarImpl.java @@ -4,7 +4,9 @@ package com.intellij.codeInsight.daemon.impl; import com.intellij.codeHighlighting.*; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; +import com.intellij.openapi.extensions.ExtensionPointListener; import com.intellij.openapi.extensions.ExtensionPointName; +import com.intellij.openapi.extensions.PluginDescriptor; import com.intellij.openapi.project.DumbService; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiCompiledElement; @@ -36,8 +38,28 @@ public class TextEditorHighlightingPassRegistrarImpl extends TextEditorHighlight public TextEditorHighlightingPassRegistrarImpl(@NotNull Project project) { myProject = project; + registerFactories(); + + EP_NAME.addExtensionPointListener(new ExtensionPointListener() { + @Override + public void extensionAdded(@NotNull TextEditorHighlightingPassFactoryRegistrar factoryRegistrar, + @NotNull PluginDescriptor pluginDescriptor) { + factoryRegistrar.registerHighlightingPassFactory(TextEditorHighlightingPassRegistrarImpl.this, project); + } + + @Override + public void extensionRemoved(@NotNull TextEditorHighlightingPassFactoryRegistrar factoryRegistrar, + @NotNull PluginDescriptor pluginDescriptor) { + myRegisteredPassFactories.clear(); + myDirtyScopeTrackingFactories.clear(); + registerFactories(); + } + }, myProject); + } + + public void registerFactories() { for (TextEditorHighlightingPassFactoryRegistrar factoryRegistrar : EP_NAME.getExtensionList()) { - factoryRegistrar.registerHighlightingPassFactory(this, project); + factoryRegistrar.registerHighlightingPassFactory(this, myProject); } } diff --git a/platform/platform-resources/src/META-INF/LangExtensionPoints.xml b/platform/platform-resources/src/META-INF/LangExtensionPoints.xml index 5725e4c74824..0e4ee27ac99b 100644 --- a/platform/platform-resources/src/META-INF/LangExtensionPoints.xml +++ b/platform/platform-resources/src/META-INF/LangExtensionPoints.xml @@ -6,7 +6,7 @@ - +