(IJPL-150109) ML in SE: update Quick Definition when changing selection in Search Everywhere with semantic search

GitOrigin-RevId: c8039eac7da03429261f88ff12a796d0e8772d6a
This commit is contained in:
Evgeny Abramov
2024-05-24 22:33:56 +03:00
committed by intellij-monorepo-bot
parent 31f5466c2b
commit 1886ff85fc

View File

@@ -6,6 +6,7 @@ import com.intellij.codeInsight.hint.ImplementationViewElement;
import com.intellij.codeInsight.hint.ImplementationViewSession;
import com.intellij.codeInsight.hint.ImplementationViewSessionFactory;
import com.intellij.ide.actions.searcheverywhere.PSIPresentationBgRendererWrapper;
import com.intellij.ide.actions.searcheverywhere.PsiItemWithSimilarity;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.project.DumbAwareAction;
import com.intellij.openapi.project.DumbService;
@@ -77,6 +78,9 @@ public abstract class ShowRelatedElementsActionBase extends DumbAwareAction impl
protected abstract @NlsContexts.PopupContent String getIndexNotReadyMessage();
private void updateElementImplementations(Object lookupItemObject, ImplementationViewSession session) {
if (lookupItemObject instanceof PsiItemWithSimilarity<?> itemWithSimilarity) {
lookupItemObject = itemWithSimilarity.getValue();
}
if (lookupItemObject instanceof PSIPresentationBgRendererWrapper.PsiItemWithPresentation) {
lookupItemObject = ((PSIPresentationBgRendererWrapper.PsiItemWithPresentation)lookupItemObject).getItem();
}