use of com.intellij.usages.PsiNamedElementUsageGroupBase in project Perl5-IDEA by Camelcade.
the class PodUsageGroupingRule method getParentGroupFor.
@Override
@Nullable
protected UsageGroup getParentGroupFor(@NotNull Usage usage, @NotNull UsageTarget[] targets) {
if (!(usage instanceof PsiElementUsage)) {
return null;
}
PsiElement element = ((PsiElementUsage) usage).getElement();
if (element == null || !element.getLanguage().isKindOf(PodLanguage.INSTANCE)) {
return null;
}
PsiElement structuralParentElement = PodBreadCrumbsProvider.getStructuralParentElement(element);
if (structuralParentElement instanceof PodTitledSection) {
return new PsiNamedElementUsageGroupBase<>((PodTitledSection) structuralParentElement);
}
return null;
}
Aggregations