[multiverse] IJPL-339 rename EditorFilterUpdater for simpler search

GitOrigin-RevId: ac3d009aaf300d782dbe868eabba61d390de7f2c
This commit is contained in:
Max Medvedev
2025-10-20 19:42:38 +00:00
committed by intellij-monorepo-bot
parent 2362ad6fb9
commit fdab1bb2ba
2 changed files with 6 additions and 6 deletions
@@ -1,4 +1,4 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.codeInsight.multiverse
import com.intellij.openapi.editor.impl.EditorHighlightingPredicate
@@ -7,21 +7,21 @@ import com.intellij.openapi.editor.markup.RangeHighlighter
import com.intellij.openapi.util.Key
import com.intellij.util.application
internal class EditorFilterUpdater : EditorContextManager.ChangeEventListener {
internal class MultiverseEditorFilterUpdater : EditorContextManager.ChangeEventListener {
override fun editorContextsChanged(event: EditorContextManager.ChangeEvent) {
val editor = event.editor as? EditorImpl ?: return
application.invokeLater {
val predicate = EditorSelectedContextsPredicate(event.newContexts)
val predicate = MultiverseEditorSelectedContextsPredicate(event.newContexts)
editor.addHighlightingPredicate(editorPredicateKey, predicate)
}
}
}
private class EditorSelectedContextsPredicate(val contexts: EditorSelectedContexts) : EditorHighlightingPredicate {
private class MultiverseEditorSelectedContextsPredicate(val contexts: EditorSelectedContexts) : EditorHighlightingPredicate {
override fun shouldRender(highlighter: RangeHighlighter): Boolean {
val highlighterContext = highlighter.codeInsightContext ?: return true
return highlighterContext in contexts
}
}
private val editorPredicateKey: Key<EditorSelectedContextsPredicate> = Key.create("editorPredicateEquality")
private val editorPredicateKey: Key<MultiverseEditorSelectedContextsPredicate> = Key.create("multiverseEditorPredicateEquality")
@@ -2112,7 +2112,7 @@
topic="com.intellij.codeInsight.template.TemplateManagerListener"/>
<listener class="com.intellij.ide.actionsOnSave.impl.ActionsOnSaveFileDocumentManagerListener"
topic="com.intellij.openapi.fileEditor.FileDocumentManagerListener"/>
<listener class="com.intellij.codeInsight.multiverse.EditorFilterUpdater"
<listener class="com.intellij.codeInsight.multiverse.MultiverseEditorFilterUpdater"
topic="com.intellij.codeInsight.multiverse.EditorContextManager$ChangeEventListener"/>
</projectListeners>