List<LineMarkerInfo<PsiElement>> (@NotNull PsiIdentifier identifier, @NotNull PsiMethodCallExpression methodCall) { if (PsiUtil.isLanguageLevel9OrHigher(methodCall)) { PsiExpression[] arguments = methodCall.getArgumentList().getExpressions(); JavaReflectionReferenceUtil.ReflectiveType serviceType = null; for (int i = 0; i < arguments.length && serviceType == null; i++) { serviceType = JavaReflectionReferenceUtil.getReflectiveType(arguments[i]); } if (serviceType != null && serviceType.isExact()) { PsiClass psiClass = serviceType.getPsiClass(); if (psiClass != null) { String qualifiedName = psiClass.getQualifiedName(); if (qualifiedName != null) { PsiJavaModule javaModule = JavaModuleGraphUtil.findDescriptorByElement(methodCall); if (javaModule != null) { for (PsiUsesStatement statement : javaModule.getUses()) { PsiClassType usedClass = statement.getClassType(); if (usedClass != null && psiClass.equals(usedClass.resolve())) { LineMarkerInfo<PsiElement> info = new LineMarkerInfo<>(identifier, identifier.getTextRange(), AllIcons.Gutter.Java9Service, e -> calculateTooltip("service.uses", qualifiedName), new ServiceUsesNavigationHandler(qualifiedName), GutterIconRenderer.Alignment.LEFT); return Collections.singletonList(info); } } } } } } } return Collections.emptyList(); }