33import com .cedricziel .idea .typo3 .TYPO3CMSIcons ;
44import com .cedricziel .idea .typo3 .index .RouteIndex ;
55import com .cedricziel .idea .typo3 .psi .PhpElementsUtil ;
6+ import com .cedricziel .idea .typo3 .routing .RouteHelper ;
67import com .cedricziel .idea .typo3 .routing .RouteStub ;
78import com .intellij .codeInsight .daemon .RelatedItemLineMarkerInfo ;
89import com .intellij .codeInsight .daemon .RelatedItemLineMarkerProvider ;
1718
1819public class RouteLineMarkerProvider extends RelatedItemLineMarkerProvider {
1920 @ Override
20- protected void collectNavigationMarkers (@ NotNull PsiElement element , Collection <? super RelatedItemLineMarkerInfo > result ) {
21+ protected void collectNavigationMarkers (@ NotNull PsiElement element , @ NotNull Collection <? super RelatedItemLineMarkerInfo > result ) {
2122
2223 if (!(element instanceof StringLiteralExpression )) {
2324 return ;
@@ -36,8 +37,14 @@ protected void collectNavigationMarkers(@NotNull PsiElement element, Collection<
3637 if (RouteIndex .hasRoute (element .getProject (), value )) {
3738 Collection <RouteStub > routes = RouteIndex .getRoute (element .getProject (), value );
3839 routes .forEach (def -> {
40+ PsiElement [] routeDefinitionElements = RouteHelper .getRouteDefinitionElements (element .getProject (), value );
3941 NavigationGutterIconBuilder <PsiElement > builder = NavigationGutterIconBuilder
40- .create (TYPO3CMSIcons .ROUTE_ICON );
42+ .create (TYPO3CMSIcons .ROUTE_ICON )
43+ .setTargets (routeDefinitionElements );
44+
45+ if (def .getPath () != null ) {
46+ builder .setTooltipTitle ("Path: " + def .getPath ());
47+ }
4148
4249 result .add (builder .createLineMarkerInfo (element ));
4350 });
0 commit comments