Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1639: Remove SearchGutterIconNavigationHandler and simplify markers #2485

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0).
Replaced hardcoded Magento versions with dynamic fetching via Packagist API.
Fixed UI icon references.
Updated Run command.
- java.lang.Throwable: Assertion failed: Do not use PsiElement for popup model. See PsiTargetNavigator [#2485](https://github.com/magento/magento2-phpstorm-plugin/pull/2485)

### Changed

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,17 @@

package com.magento.idea.magento2plugin.linemarker.php;

import com.intellij.codeInsight.daemon.GutterIconNavigationHandler;
import com.intellij.codeInsight.daemon.LineMarkerInfo;
import com.intellij.codeInsight.daemon.LineMarkerProvider;
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder;
import com.intellij.icons.AllIcons;
import com.intellij.psi.NavigatablePsiElement;
import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiElement;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.util.indexing.FileBasedIndex;
import com.jetbrains.php.lang.lexer.PhpTokenTypes;
import com.jetbrains.php.lang.psi.elements.Method;
import com.jetbrains.php.lang.psi.elements.PhpClass;
import com.magento.idea.magento2plugin.linemarker.SearchGutterIconNavigationHandler;
import com.magento.idea.magento2plugin.linemarker.php.data.PluginMethodData;
import com.magento.idea.magento2plugin.project.Settings;
import com.magento.idea.magento2plugin.stubs.indexes.PluginIndex;
Expand Down Expand Up @@ -74,22 +72,16 @@ public void collectSlowLineMarkers(
}

if (!results.isEmpty()) {
final GutterIconNavigationHandler<PsiElement> navigationHandler =
new SearchGutterIconNavigationHandler<>(
(Collection<? extends NavigatablePsiElement>) results,
TOOLTIP_TEXT
);

collection.add(
NavigationGutterIconBuilder
.create(AllIcons.Nodes.Plugin)
.setTargets(results)
.setTooltipText(TOOLTIP_TEXT)
.createLineMarkerInfo(
PsiTreeUtil.getDeepestFirst(psiElement),
navigationHandler
)
);
final ASTNode node = psiElement.getNode()
.findChildByType(PhpTokenTypes.IDENTIFIER);
if (node != null) {
// Add the property to a collection of line marker info
final NavigationGutterIconBuilder<PsiElement> builder =
NavigationGutterIconBuilder.create(AllIcons.Nodes.Plugin)
.setTargets(results)
.setTooltipText(TOOLTIP_TEXT);
collection.add(builder.createLineMarkerInfo(node.getPsi()));
}
}
}
}
Expand Down
Loading