diff --git a/platform/searchEverywhere/frontend/resources/intellij.platform.searchEverywhere.frontend.xml b/platform/searchEverywhere/frontend/resources/intellij.platform.searchEverywhere.frontend.xml index cbd449b163e3..fb361d8efe5d 100644 --- a/platform/searchEverywhere/frontend/resources/intellij.platform.searchEverywhere.frontend.xml +++ b/platform/searchEverywhere/frontend/resources/intellij.platform.searchEverywhere.frontend.xml @@ -12,6 +12,10 @@ + + diff --git a/platform/searchEverywhere/frontend/src/SeFrontendItemDataProvidersFacade.kt b/platform/searchEverywhere/frontend/src/SeFrontendItemDataProvidersFacade.kt index 0d8ea6f0b961..c7c6bc8d6849 100644 --- a/platform/searchEverywhere/frontend/src/SeFrontendItemDataProvidersFacade.kt +++ b/platform/searchEverywhere/frontend/src/SeFrontendItemDataProvidersFacade.kt @@ -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-2026 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.platform.searchEverywhere.frontend import com.intellij.ide.rpc.DataContextId @@ -11,6 +11,7 @@ import com.intellij.platform.searchEverywhere.SeSession import com.intellij.platform.searchEverywhere.SeTransferEnd import com.intellij.platform.searchEverywhere.SeTransferEvent import com.intellij.platform.searchEverywhere.SeTransferItem +import com.intellij.platform.searchEverywhere.frontend.ui.SePreviewPanelListener import com.intellij.platform.searchEverywhere.impl.SeRemoteApi import com.intellij.platform.searchEverywhere.presentations.SeItemPresentation import com.intellij.platform.searchEverywhere.providers.SeLog @@ -72,6 +73,7 @@ class SeFrontendItemDataProvidersFacade(private val projectId: ProjectId, modifiers: Int, searchText: String, ): Boolean { + SePreviewPanelListener.EP.forEachExtensionSafe { it.onItemSelected() } return SeRemoteApi.getInstance().itemSelected(projectId, session, itemData, modifiers, searchText, isAllTab = isAllTab) } diff --git a/platform/searchEverywhere/frontend/src/SePreviewPanelListener.kt b/platform/searchEverywhere/frontend/src/SePreviewPanelListener.kt new file mode 100644 index 000000000000..ad02d93a3ef1 --- /dev/null +++ b/platform/searchEverywhere/frontend/src/SePreviewPanelListener.kt @@ -0,0 +1,23 @@ +// Copyright 2000-2026 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +package com.intellij.platform.searchEverywhere.frontend.ui + +import com.intellij.openapi.editor.Editor +import com.intellij.openapi.extensions.ExtensionPointName +import org.jetbrains.annotations.ApiStatus + +/** + * A very internal hack for fixing IJPL-237895. A subject to removal. Please do not use it. + */ +@ApiStatus.Internal +@FunctionalInterface +interface SePreviewPanelListener { + companion object { + val EP: ExtensionPointName = ExtensionPointName.create("com.intellij.searchEverywhere.previewPanelListener") + } + + /** + * Called, when new [editor] is used to show a preview in Search Everywhere preview tab + */ + fun onNewPreviewEditor(editor: Editor) + fun onItemSelected() +} \ No newline at end of file diff --git a/platform/searchEverywhere/frontend/src/ui/SePopupContentPane.kt b/platform/searchEverywhere/frontend/src/ui/SePopupContentPane.kt index b99303bf42ab..cca7d7a00bf2 100644 --- a/platform/searchEverywhere/frontend/src/ui/SePopupContentPane.kt +++ b/platform/searchEverywhere/frontend/src/ui/SePopupContentPane.kt @@ -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-2026 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.platform.searchEverywhere.frontend.ui import com.intellij.icons.AllIcons @@ -1073,6 +1073,7 @@ class SePopupContentPane( } override fun onEditorCreated(editor: Editor) { + SePreviewPanelListener.EP.forEachExtensionSafe { it.onNewPreviewEditor(editor) } if (editor is EditorEx) { editor.setRendererMode(true) }