@Override
    protected UsageGroup getParentGroupFor(Usage usage, UsageTarget[] targets) {
        PsiElement psiElement = usage instanceof PsiElementUsage ? ((PsiElementUsage)usage).getElement() : null;
        if (psiElement == null || psiElement.getLanguage() != SdLanguage.INSTANCE) return null;
    
        while (psiElement != null) {
            if (psiElement instanceof SdDocumentSummaryDefinition) {
                SdDocumentSummaryDefinition componentElement = (SdDocumentSummaryDefinition) psiElement;
                return new SdUsageGroup(componentElement);
            }
            psiElement = psiElement.getParent();
        }
    
        return null;
    }
A grouping rule that groups elements in the "Find Usages" window.

@author Shahar Ariel
integration/intellij/src/main/java/ai/vespa/intellij/schema/findUsages/SdDocumentSummaryGroupingRule.java