Search in sources :

Example 1 with UsageGroupingRuleEx

use of com.intellij.usages.rules.UsageGroupingRuleEx in project intellij-community by JetBrains.

the class UsageNodeTreeBuilder method appendUsage.

UsageNode appendUsage(@NotNull Usage usage, @NotNull Consumer<Node> edtInsertedUnderQueue, boolean filterDuplicateLines) {
    if (!isVisible(usage))
        return null;
    final boolean dumb = DumbService.isDumb(myProject);
    GroupNode groupNode = myRoot;
    for (int i = 0; i < myGroupingRules.length; i++) {
        UsageGroupingRule rule = myGroupingRules[i];
        if (dumb && !DumbService.isDumbAware(rule))
            continue;
        UsageGroup group = rule instanceof UsageGroupingRuleEx ? ((UsageGroupingRuleEx) rule).groupUsage(usage, myTargets) : rule.groupUsage(usage);
        if (group != null) {
            groupNode = groupNode.addOrGetGroup(group, i, edtInsertedUnderQueue);
        }
    }
    return groupNode.addUsage(usage, edtInsertedUnderQueue, filterDuplicateLines);
}
Also used : UsageGroupingRule(com.intellij.usages.rules.UsageGroupingRule) UsageGroup(com.intellij.usages.UsageGroup) UsageGroupingRuleEx(com.intellij.usages.rules.UsageGroupingRuleEx)

Aggregations

UsageGroup (com.intellij.usages.UsageGroup)1 UsageGroupingRule (com.intellij.usages.rules.UsageGroupingRule)1 UsageGroupingRuleEx (com.intellij.usages.rules.UsageGroupingRuleEx)1