use of org.jetbrains.plugins.groovy.dgm.GdkMethodHolder in project intellij-community by JetBrains.
the class GdkMethodDslProvider method processCategoryMethods.
private static void processCategoryMethods(final String className, final GdslMembersHolderConsumer consumer, final boolean isStatic) {
final GlobalSearchScope scope = consumer.getResolveScope();
final PsiClass categoryClass = JavaPsiFacade.getInstance(consumer.getProject()).findClass(className, scope);
if (categoryClass == null) {
return;
}
final VolatileNotNullLazyValue<GdkMethodHolder> methodsMap = new VolatileNotNullLazyValue<GdkMethodHolder>() {
@NotNull
@Override
protected GdkMethodHolder compute() {
return GdkMethodHolder.getHolderForClass(categoryClass, isStatic, scope);
}
};
consumer.addMemberHolder(new CustomMembersHolder() {
@Override
public boolean processMembers(GroovyClassDescriptor descriptor, PsiScopeProcessor _processor, ResolveState state) {
for (PsiScopeProcessor each : GroovyResolverProcessor.allProcessors(_processor)) {
if (ResolveUtil.shouldProcessMethods(each.getHint(ElementClassHint.KEY)) && !methodsMap.getValue().processMethods(each, state, descriptor.getPsiType(), descriptor.getProject())) {
return false;
}
}
return true;
}
});
}
Aggregations