|
5 | 5 |
|
6 | 6 | package com.magento.idea.magento2plugin.linemarker.php;
|
7 | 7 |
|
8 |
| -import com.intellij.codeInsight.daemon.GutterIconNavigationHandler; |
9 | 8 | import com.intellij.codeInsight.daemon.LineMarkerInfo;
|
10 | 9 | import com.intellij.codeInsight.daemon.LineMarkerProvider;
|
11 | 10 | import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder;
|
12 | 11 | import com.intellij.icons.AllIcons;
|
13 |
| -import com.intellij.psi.NavigatablePsiElement; |
14 | 12 | import com.intellij.psi.PsiElement;
|
15 | 13 | import com.intellij.psi.search.GlobalSearchScope;
|
16 |
| -import com.intellij.psi.util.PsiTreeUtil; |
17 | 14 | import com.intellij.util.indexing.FileBasedIndex;
|
18 | 15 | import com.jetbrains.php.lang.psi.elements.Method;
|
19 | 16 | import com.jetbrains.php.lang.psi.elements.PhpClass;
|
20 |
| -import com.magento.idea.magento2plugin.linemarker.SearchGutterIconNavigationHandler; |
21 | 17 | import com.magento.idea.magento2plugin.linemarker.php.data.PluginMethodData;
|
22 | 18 | import com.magento.idea.magento2plugin.project.Settings;
|
23 | 19 | import com.magento.idea.magento2plugin.stubs.indexes.PluginIndex;
|
@@ -74,22 +70,12 @@ public void collectSlowLineMarkers(
|
74 | 70 | }
|
75 | 71 |
|
76 | 72 | 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) |
86 | 76 | .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)); |
93 | 79 | }
|
94 | 80 | }
|
95 | 81 | }
|
|
0 commit comments