Skip to content

Commit 1491c0c

Browse files
committed
1639: Remove SearchGutterIconNavigationHandler and simplify markers
Deleted the unused `SearchGutterIconNavigationHandler` class and replaced its implementation in `PluginLineMarkerProvider` with direct `NavigationGutterIconBuilder` usage. This simplifies the code and removes redundant complexity.
1 parent 0846494 commit 1491c0c

File tree

2 files changed

+5
-66
lines changed

2 files changed

+5
-66
lines changed

src/main/java/com/magento/idea/magento2plugin/linemarker/SearchGutterIconNavigationHandler.java

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/main/java/com/magento/idea/magento2plugin/linemarker/php/PluginLineMarkerProvider.java

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,15 @@
55

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

8-
import com.intellij.codeInsight.daemon.GutterIconNavigationHandler;
98
import com.intellij.codeInsight.daemon.LineMarkerInfo;
109
import com.intellij.codeInsight.daemon.LineMarkerProvider;
1110
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder;
1211
import com.intellij.icons.AllIcons;
13-
import com.intellij.psi.NavigatablePsiElement;
1412
import com.intellij.psi.PsiElement;
1513
import com.intellij.psi.search.GlobalSearchScope;
16-
import com.intellij.psi.util.PsiTreeUtil;
1714
import com.intellij.util.indexing.FileBasedIndex;
1815
import com.jetbrains.php.lang.psi.elements.Method;
1916
import com.jetbrains.php.lang.psi.elements.PhpClass;
20-
import com.magento.idea.magento2plugin.linemarker.SearchGutterIconNavigationHandler;
2117
import com.magento.idea.magento2plugin.linemarker.php.data.PluginMethodData;
2218
import com.magento.idea.magento2plugin.project.Settings;
2319
import com.magento.idea.magento2plugin.stubs.indexes.PluginIndex;
@@ -74,22 +70,12 @@ public void collectSlowLineMarkers(
7470
}
7571

7672
if (!results.isEmpty()) {
77-
final GutterIconNavigationHandler<PsiElement> navigationHandler =
78-
new SearchGutterIconNavigationHandler<>(
79-
(Collection<? extends NavigatablePsiElement>) results,
80-
TOOLTIP_TEXT
81-
);
82-
83-
collection.add(
84-
NavigationGutterIconBuilder
85-
.create(AllIcons.Nodes.Plugin)
73+
// Add the property to a collection of line marker info
74+
NavigationGutterIconBuilder<PsiElement> builder =
75+
NavigationGutterIconBuilder.create(AllIcons.Nodes.Plugin)
8676
.setTargets(results)
87-
.setTooltipText(TOOLTIP_TEXT)
88-
.createLineMarkerInfo(
89-
PsiTreeUtil.getDeepestFirst(psiElement),
90-
navigationHandler
91-
)
92-
);
77+
.setTooltipText(TOOLTIP_TEXT);
78+
collection.add(builder.createLineMarkerInfo(psiElement));
9379
}
9480
}
9581
}

0 commit comments

Comments
 (0)