issue declaration scope passed event in treeWalkUp

This commit is contained in:
peter
2012-08-31 16:37:59 +02:00
parent 7ad32d0ee1
commit 97143f7e32
3 changed files with 10 additions and 7 deletions
@@ -49,7 +49,6 @@ import org.jetbrains.plugins.groovy.lang.psi.impl.synthetic.ClosureSyntheticPara
import org.jetbrains.plugins.groovy.lang.psi.impl.synthetic.GrLightVariable;
import org.jetbrains.plugins.groovy.lang.resolve.MethodTypeInferencer;
import org.jetbrains.plugins.groovy.lang.resolve.ResolveUtil;
import org.jetbrains.plugins.groovy.lang.resolve.processors.PropertyResolverProcessor;
import org.jetbrains.plugins.groovy.lang.resolve.processors.ResolverProcessor;
import org.jetbrains.plugins.groovy.refactoring.GroovyNamesUtil;
@@ -127,10 +126,6 @@ public class GrClosableBlockImpl extends GrBlockImpl implements GrClosableBlock
}
private boolean processOwner(PsiScopeProcessor processor, ResolveState state) {
if (processor instanceof PropertyResolverProcessor && OWNER_NAME.equals(((PropertyResolverProcessor)processor).getName())) {
processor.handleEvent(ResolveUtil.DECLARATION_SCOPE_PASSED, this);
}
String nameHint = ResolveUtil.getNameHint(processor);
if (nameHint == null || nameHint.equals(OWNER_NAME)) {
if (!processor.execute(getOwner(), state)) return false;
@@ -156,8 +156,6 @@ public abstract class GrMethodBaseImpl extends GrStubElementBase<GrMethodStub> i
if (!ResolveUtil.processElement(processor, parameter, state)) return false;
}
processor.handleEvent(ResolveUtil.DECLARATION_SCOPE_PASSED, this);
return true;
}
@@ -55,6 +55,7 @@ import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrAnonymousC
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrTypeDefinition;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrGdkMethod;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrMember;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrMethod;
import org.jetbrains.plugins.groovy.lang.psi.api.types.GrCodeReferenceElement;
import org.jetbrains.plugins.groovy.lang.psi.impl.GrClosureType;
import org.jetbrains.plugins.groovy.lang.psi.impl.GroovyResolveResultImpl;
@@ -109,7 +110,16 @@ public class ResolveUtil {
}
}
if (run instanceof GrClosableBlock && GrClosableBlock.OWNER_NAME.equals(getNameHint(processor))) {
processor.handleEvent(DECLARATION_SCOPE_PASSED, run);
}
if (!run.processDeclarations(processor, ResolveState.initial(), lastParent, place)) return false;
if (run instanceof GrMethod) {
processor.handleEvent(DECLARATION_SCOPE_PASSED, run);
}
if (processNonCodeMethods) {
if (!doProcessNonCodeMembers) {
if (run instanceof GrCodeBlock) doProcessNonCodeMembers = true;