UsageType (PsiElement element, UsageTarget @NotNull [] targets) { if (element == null) return null; if (PsiTreeUtil.getParentOfType(element, PsiComment.class, false) != null) { return UsageType.COMMENT_USAGE; } for(UsageTypeProvider provider: UsageTypeProvider.EP_NAME.getExtensionList()) { UsageType usageType; if (provider instanceof UsageTypeProviderEx) { usageType = ((UsageTypeProviderEx) provider).getUsageType(element, targets); } else { usageType = provider.getUsageType(element); } if (usageType != null) { return usageType; } } return null; }