mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[multiverse] IJPL-339 rename EditorFilterUpdater for simpler search
GitOrigin-RevId: ac3d009aaf300d782dbe868eabba61d390de7f2c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2362ad6fb9
commit
fdab1bb2ba
+5
-5
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user