@Override public boolean process(SymbolCollectingProcessor.ResultWithContext result) { final PsiElement context = result.getFileContext(); myProcessor.handleEvent(JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT, context); final PsiNamedElement element = result.getElement(); if(element instanceof PsiClass && context instanceof PsiImportStatement) { final PsiClass containingClass = ((PsiClass) element).getContainingClass(); if(containingClass != null && containingClass.hasTypeParameters()) { return myProcessor.execute(element, myState.put(PsiSubstitutor.KEY, createRawSubstitutor(containingClass))); } } return myProcessor.execute(element, myState); }
@Override public void handleEvent(@NotNull Event event, Object associated) { if(event == JavaScopeProcessorEvent.START_STATIC) { myStatic = true; } if(event == JavaScopeProcessorEvent.CHANGE_LEVEL) { myMembersFlag = true; myFinishedScopesMethodNames.addAll(myCurrentScopeMethodNames); myCurrentScopeMethodNames.clear(); } if(event == JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT) { myDeclarationHolder = (PsiElement) associated; } }
@Override public void handleEvent(@NotNull Event event, Object associated) { if (event == JavaScopeProcessorEvent.START_STATIC) { myStaticScopeFlag = true; } else if (JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT.equals(event)) { myCurrentFileContext = (PsiElement)associated; } }
@Override public void handleEvent(@NotNull Event event, Object associated) { if (event == JavaScopeProcessorEvent.CHANGE_LEVEL) { if (myHasAccessibleStaticCorrectCandidate) myStopAcceptingCandidates = true; } super.handleEvent(event, associated); }
public static boolean treeWalkUp(@NotNull final PsiScopeProcessor processor, @NotNull final PsiElement entrance, @Nullable final PsiElement maxScope, @NotNull final ResolveState state) { if (!entrance.isValid()) { LOG.error(new PsiInvalidElementAccessException(entrance)); } PsiElement prevParent = entrance; PsiElement scope = entrance; while (scope != null) { ProgressIndicatorProvider.checkCanceled(); if (scope instanceof PsiClass) { processor.handleEvent(JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT, scope); } if (!scope.processDeclarations(processor, state, prevParent, entrance)) { return false; // resolved } if (scope instanceof PsiModifierListOwner && !(scope instanceof PsiParameter/* important for not loading tree! */)) { PsiModifierList modifierList = ((PsiModifierListOwner)scope).getModifierList(); if (modifierList != null && modifierList.hasModifierProperty(PsiModifier.STATIC)) { processor.handleEvent(JavaScopeProcessorEvent.START_STATIC, null); } } if (scope == maxScope) break; prevParent = scope; scope = prevParent.getContext(); processor.handleEvent(JavaScopeProcessorEvent.CHANGE_LEVEL, null); } return true; }
@Override public void handleEvent(@NotNull PsiScopeProcessor.Event event, Object associated) { if (event == JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT) { myCurrentFileContext = (PsiElement)associated; myCurrentContextAnchor = null; } }
@Override public final void handleEvent(@NotNull PsiScopeProcessor.Event event, Object associated) { super.handleEvent(event, associated); if(event == JavaScopeProcessorEvent.START_STATIC){ myStaticScopeFlag = true; } else if (JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT.equals(event)) { myCurrentFileContext = (PsiElement)associated; } }
@Override public void handleEvent(@NotNull final Event event, final Object associated) { if (JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT.equals(event) && associated instanceof PsiImportStaticStatement) { final PsiImportStaticStatement importStaticStatement = (PsiImportStaticStatement)associated; myIsProcessingOnDemand = importStaticStatement.isOnDemand(); if (!myIsProcessingOnDemand) { myHiddenNames.add(importStaticStatement.getReferenceName()); } } myDelegate.handleEvent(event, associated); }
@Override public boolean process(SymbolCollectingProcessor.ResultWithContext result) { final PsiElement context = result.getFileContext(); myProcessor.handleEvent(JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT, context); final PsiNamedElement element = result.getElement(); if (element instanceof PsiClass && context instanceof PsiImportStatement) { final PsiClass containingClass = ((PsiClass)element).getContainingClass(); if (containingClass != null && containingClass.hasTypeParameters()) { return myProcessor.execute(element, myState.put(PsiSubstitutor.KEY, createRawSubstitutor(containingClass))); } } return myProcessor.execute(element, myState); }
@Override public void handleEvent(@NotNull Event event, Object associated){ if(event == JavaScopeProcessorEvent.START_STATIC){ myStatic = true; } if(event == JavaScopeProcessorEvent.CHANGE_LEVEL){ myMembersFlag = true; } if (event == JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT) { myDeclarationHolder = (PsiElement)associated; } }
@Override public void handleEvent(@NotNull final Event event, final Object associated) { if ((event == JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT || event == Event.SET_DECLARATION_HOLDER) && !myResults.isEmpty()) { setFound(); } super.handleEvent(event, associated); }
static void issueLevelChangeEvents(PsiScopeProcessor processor, PsiElement run) { processor.handleEvent(JavaScopeProcessorEvent.CHANGE_LEVEL, null); if (run instanceof GrClosableBlock && GrClosableBlock.OWNER_NAME.equals(getNameHint(processor)) || run instanceof PsiClass && !(run instanceof PsiAnonymousClass) || run instanceof GrMethod && run.getParent() instanceof GroovyFile) { processor.handleEvent(DECLARATION_SCOPE_PASSED, run); } }
@Override public void handleEvent(@NotNull Event event, Object associated) { super.handleEvent(event, associated); if (JavaScopeProcessorEvent.CHANGE_LEVEL == event && hasApplicableCandidates()) { myStopExecuting = true; } }
@Override public final void handleEvent(final @NotNull Event event, final Object associated) { if (event == JavaScopeProcessorEvent.START_STATIC) { //log("starting static scope at " + currentLevel); inStaticScope = true; } else if (event == JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT) { if (associated instanceof PsiAnonymousClass) classes.add(new Shadow<PsiClass>((PsiClass)associated,currentLevel)); //log("switching context: " + associated); } else if (event == JavaScopeProcessorEvent.CHANGE_LEVEL) { currentLevel++; //log("change level to " + currentLevel + ", associated " + associated); } }
@Override public final void handleEvent(@NotNull Event event, Object associated){ if (event == JavaScopeProcessorEvent.START_STATIC) { logger.debug("starting static scope"); inStaticScope = true; } else if (event == JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT) { currentFileContext = (PsiElement)associated; logger.debug("switching file context: " + currentFileContext); } else if (event == JavaScopeProcessorEvent.CHANGE_LEVEL) { currentLevel++; logger.debug("change level to " + currentLevel); } }
@Override public void handleEvent(Event event, Object associated) { if (event == JavaScopeProcessorEvent.START_STATIC) { myStaticScopeFlag = true; } else if (JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT.equals(event)) { myCurrentFileContext = (PsiElement)associated; } }
@Override public void handleEvent(Event event, Object associated) { if (event == JavaScopeProcessorEvent.CHANGE_LEVEL) { if (myHasAccessibleStaticCorrectCandidate) myStopAcceptingCandidates = true; } super.handleEvent(event, associated); }
@Override public final void handleEvent(PsiScopeProcessor.Event event, Object associated) { super.handleEvent(event, associated); if(event == JavaScopeProcessorEvent.START_STATIC){ myStaticScopeFlag = true; } else if (JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT.equals(event)) { myCurrentFileContext = (PsiElement)associated; } }
@Override public void handleEvent(final Event event, final Object associated) { if (JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT.equals(event) && associated instanceof PsiImportStaticStatement) { final PsiImportStaticStatement importStaticStatement = (PsiImportStaticStatement)associated; myIsProcessingOnDemand = importStaticStatement.isOnDemand(); if (!myIsProcessingOnDemand) { myHiddenNames.add(importStaticStatement.getReferenceName()); } } myDelegate.handleEvent(event, associated); }
@Override public void handleEvent(Event event, Object associated){ if(event == JavaScopeProcessorEvent.START_STATIC){ myStatic = true; } if(event == JavaScopeProcessorEvent.CHANGE_LEVEL){ myMembersFlag = true; } if (event == JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT) { myDeclarationHolder = (PsiElement)associated; } }
@Override public void handleEvent(final Event event, final Object associated) { if ((event == JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT || event == Event.SET_DECLARATION_HOLDER) && !myResults.isEmpty()) { setFound(); } super.handleEvent(event, associated); }
@Override public void handleEvent(Event event, Object associated) { super.handleEvent(event, associated); if (JavaScopeProcessorEvent.CHANGE_LEVEL == event && super.hasCandidates()) { myStopExecuting = true; } }
@Override public void handleEvent(@NotNull PsiScopeProcessor.Event event, Object associated) { if(event == JavaScopeProcessorEvent.CHANGE_LEVEL && myName != null) { getResult(); } }
@Override public void handleEvent(@NotNull Event event, Object associated) { if(event == JavaScopeProcessorEvent.START_STATIC) { myStaticScopeFlag = true; } else if(JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT.equals(event)) { myCurrentFileContext = (PsiElement) associated; } }
@Override public void handleEvent(@NotNull Event event, Object associated) { if(event == JavaScopeProcessorEvent.CHANGE_LEVEL) { if(myHasAccessibleStaticCorrectCandidate) { myStopAcceptingCandidates = true; } } super.handleEvent(event, associated); }
public static boolean treeWalkUp(@NotNull final PsiScopeProcessor processor, @NotNull final PsiElement entrance, @Nullable final PsiElement maxScope, @NotNull final ResolveState state) { if(!entrance.isValid()) { LOG.error(new PsiInvalidElementAccessException(entrance)); } PsiElement prevParent = entrance; PsiElement scope = entrance; while(scope != null) { ProgressIndicatorProvider.checkCanceled(); if(scope instanceof PsiClass) { processor.handleEvent(JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT, scope); } if(!scope.processDeclarations(processor, state, prevParent, entrance)) { return false; // resolved } if(scope instanceof PsiModifierListOwner && !(scope instanceof PsiParameter/* important for not loading tree! */)) { PsiModifierList modifierList = ((PsiModifierListOwner) scope).getModifierList(); if(modifierList != null && modifierList.hasModifierProperty(PsiModifier.STATIC)) { processor.handleEvent(JavaScopeProcessorEvent.START_STATIC, null); } } if(scope == maxScope) { break; } prevParent = scope; scope = prevParent.getContext(); processor.handleEvent(JavaScopeProcessorEvent.CHANGE_LEVEL, null); } return true; }
@Override public void handleEvent(@NotNull PsiScopeProcessor.Event event, Object associated) { if(event == JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT) { myCurrentFileContext = (PsiElement) associated; } }
@Override public void handleEvent(final Event event, final Object associated) { if(JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT.equals(event) && associated instanceof PsiImportStaticStatement) { final PsiImportStaticStatement importStaticStatement = (PsiImportStaticStatement) associated; myIsProcessingOnDemand = importStaticStatement.isOnDemand(); if(!myIsProcessingOnDemand) { myHiddenNames.add(importStaticStatement.getReferenceName()); } } myDelegate.handleEvent(event, associated); }
@Override public final void handleEvent(@NotNull Event event, Object associated){ if(event == JavaScopeProcessorEvent.START_STATIC) myStaticScopeFlag = true; }
@Override public void handleEvent(@NotNull PsiScopeProcessor.Event event, Object associated) { if (event == JavaScopeProcessorEvent.CHANGE_LEVEL && myName != null) { getResult(); } }
@Override public void handleEvent(PsiScopeProcessor.Event event, Object associated) { if (event == JavaScopeProcessorEvent.CHANGE_LEVEL && myName != null) { getResult(); } }
@Override public void handleEvent(PsiScopeProcessor.Event event, Object associated) { if (event == JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT) { myCurrentFileContext = (PsiElement)associated; } }
@Override public boolean process(SymbolCollectingProcessor.ResultWithContext result) { myProcessor.handleEvent(JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT, result.getFileContext()); return myProcessor.execute(result.getElement(), myState); }
@Override public final void handleEvent(Event event, Object associated){ if(event == JavaScopeProcessorEvent.START_STATIC) myStaticScopeFlag = true; }