本文整理汇总了Java中com.intellij.psi.scope.PsiScopeProcessor.handleEvent方法的典型用法代码示例。如果您正苦于以下问题:Java PsiScopeProcessor.handleEvent方法的具体用法?Java PsiScopeProcessor.handleEvent怎么用?Java PsiScopeProcessor.handleEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.psi.scope.PsiScopeProcessor
的用法示例。
在下文中一共展示了PsiScopeProcessor.handleEvent方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processDeclarations
import com.intellij.psi.scope.PsiScopeProcessor; //导入方法依赖的package包/类
@Override
public boolean processDeclarations(@NotNull PsiScopeProcessor processor,
@NotNull ResolveState state,
PsiElement lastParent,
@NotNull PsiElement place) {
processor.handleEvent(PsiScopeProcessor.Event.SET_DECLARATION_HOLDER, this);
if (lastParent == null) return true;
if (!PsiScopesUtil.walkChildrenScopes(this, processor, state, lastParent, place)) return false;
final PsiParameter[] parameters = getParameterList().getParameters();
for (PsiParameter parameter : parameters) {
if (!processor.execute(parameter, state)) return false;
}
return true;
}
示例2: processDeclarations
import com.intellij.psi.scope.PsiScopeProcessor; //导入方法依赖的package包/类
@Override
public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @NotNull ResolveState state, PsiElement lastParent, @NotNull PsiElement place) {
processor.handleEvent(PsiScopeProcessor.Event.SET_DECLARATION_HOLDER, this);
PsiElement[] decls = getDeclaredElements();
for (PsiElement decl : decls) {
if (decl != lastParent) {
if (!processor.execute(decl, state)) return false;
}
else {
final ElementClassHint hint = processor.getHint(ElementClassHint.KEY);
if (lastParent instanceof PsiClass) {
if (hint == null || hint.shouldProcess(ElementClassHint.DeclarationKind.CLASS)) {
if (!processor.execute(lastParent, state)) return false;
}
}
}
}
return true;
}
示例3: processDeclarations
import com.intellij.psi.scope.PsiScopeProcessor; //导入方法依赖的package包/类
@Override
public boolean processDeclarations(@NotNull PsiScopeProcessor processor,
@NotNull ResolveState state,
PsiElement lastParent,
@NotNull PsiElement place) {
processor.handleEvent(PsiScopeProcessor.Event.SET_DECLARATION_HOLDER, this);
if (lastParent == null || lastParent.getParent() != this)
// Parent element should not see our vars
return true;
final PsiParameter catchParameter = getParameter();
if (catchParameter != null) {
return processor.execute(catchParameter, state);
}
return PsiScopesUtil.walkChildrenScopes(this, processor, state, lastParent, place);
}
示例4: processDeclarationsInMethodLike
import com.intellij.psi.scope.PsiScopeProcessor; //导入方法依赖的package包/类
private static boolean processDeclarationsInMethodLike(@NotNull final PsiElement element,
@NotNull final PsiScopeProcessor processor,
@NotNull final ResolveState state,
@NotNull final PsiElement place,
final boolean fromBody,
@Nullable final PsiTypeParameterList typeParameterList,
@NotNull final PsiParameterList parameterList) {
processor.handleEvent(PsiScopeProcessor.Event.SET_DECLARATION_HOLDER, element);
if (typeParameterList != null) {
final ElementClassHint hint = processor.getHint(ElementClassHint.KEY);
if (hint == null || hint.shouldProcess(ElementClassHint.DeclarationKind.CLASS)) {
if (!typeParameterList.processDeclarations(processor, state, null, place)) return false;
}
}
if (fromBody) {
final PsiParameter[] parameters = parameterList.getParameters();
for (PsiParameter parameter : parameters) {
if (!processor.execute(parameter, state)) return false;
}
}
return true;
}
示例5: treeWalkUp
import com.intellij.psi.scope.PsiScopeProcessor; //导入方法依赖的package包/类
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;
}
示例6: processDeclarations
import com.intellij.psi.scope.PsiScopeProcessor; //导入方法依赖的package包/类
@Override
public boolean processDeclarations(@NotNull PsiScopeProcessor processor,
@NotNull ResolveState state,
PsiElement lastParent,
@NotNull PsiElement place) {
processor.handleEvent(PsiScopeProcessor.Event.SET_DECLARATION_HOLDER, this);
final ElementClassHint classHint = processor.getHint(ElementClassHint.KEY);
if (classHint == null || classHint.shouldProcess(ElementClassHint.DeclarationKind.CLASS)) {
final PsiClass[] classes = getClasses();
for (PsiClass aClass : classes) {
if (!processor.execute(aClass, state)) return false;
}
}
return true;
}
示例7: processDeclarations
import com.intellij.psi.scope.PsiScopeProcessor; //导入方法依赖的package包/类
@Override
public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @NotNull ResolveState state, PsiElement lastParent, @NotNull PsiElement place) {
processor.handleEvent(PsiScopeProcessor.Event.SET_DECLARATION_HOLDER, this);
if (lastParent == null || lastParent.getParent() != this)
// Parent element should not see our vars
return true;
return PsiScopesUtil.walkChildrenScopes(this, processor, state, lastParent, place);
}
示例8: processDeclarations
import com.intellij.psi.scope.PsiScopeProcessor; //导入方法依赖的package包/类
@Override
public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @NotNull ResolveState state, PsiElement lastParent, @NotNull PsiElement place) {
processor.handleEvent(PsiScopeProcessor.Event.SET_DECLARATION_HOLDER, this);
if (lastParent == null) {
// Parent element should not see our vars
return true;
}
Couple<Set<String>> pair = buildMaps();
boolean conflict = pair == null;
final Set<String> classesSet = conflict ? null : pair.getFirst();
final Set<String> variablesSet = conflict ? null : pair.getSecond();
final NameHint hint = processor.getHint(NameHint.KEY);
if (hint != null && !conflict) {
final ElementClassHint elementClassHint = processor.getHint(ElementClassHint.KEY);
final String name = hint.getName(state);
if ((elementClassHint == null || elementClassHint.shouldProcess(ElementClassHint.DeclarationKind.CLASS)) && classesSet.contains(name)) {
return PsiScopesUtil.walkChildrenScopes(this, processor, state, lastParent, place);
}
if ((elementClassHint == null || elementClassHint.shouldProcess(ElementClassHint.DeclarationKind.VARIABLE)) && variablesSet.contains(name)) {
return PsiScopesUtil.walkChildrenScopes(this, processor, state, lastParent, place);
}
}
else {
return PsiScopesUtil.walkChildrenScopes(this, processor, state, lastParent, place);
}
return true;
}
示例9: processDeclarations
import com.intellij.psi.scope.PsiScopeProcessor; //导入方法依赖的package包/类
@Override
public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @NotNull ResolveState state, PsiElement lastParent, @NotNull PsiElement place) {
processor.handleEvent(PsiScopeProcessor.Event.SET_DECLARATION_HOLDER, this);
if (lastParent == null || lastParent.getParent() != this /*|| lastParent == getIteratedValue()*/)
// Parent element should not see our vars
return true;
return processor.execute(getIterationParameter(), state);
}
示例10: processDeclarations
import com.intellij.psi.scope.PsiScopeProcessor; //导入方法依赖的package包/类
@Override
public boolean processDeclarations(@NotNull PsiScopeProcessor processor,
@NotNull ResolveState state,
PsiElement lastParent,
@NotNull PsiElement place) {
processor.handleEvent(PsiScopeProcessor.Event.SET_DECLARATION_HOLDER, this);
return true;
}
示例11: processDeclarations
import com.intellij.psi.scope.PsiScopeProcessor; //导入方法依赖的package包/类
@Override
public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @NotNull ResolveState substitutor, PsiElement lastParent, @NotNull PsiElement place) {
final ASTNode astNode = getNode();
final ASTNode[] children = astNode.getChildren(GRAMMAR_CONTENT);
processor.handleEvent(PsiScopeProcessor.Event.SET_DECLARATION_HOLDER, this);
for (ASTNode element : children) {
if (!processor.execute(element.getPsi(), substitutor)) {
return false;
}
}
processor.handleEvent(PsiScopeProcessor.Event.SET_DECLARATION_HOLDER, null);
return true;
}
示例12: issueLevelChangeEvents
import com.intellij.psi.scope.PsiScopeProcessor; //导入方法依赖的package包/类
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);
}
}
示例13: processDeclarations
import com.intellij.psi.scope.PsiScopeProcessor; //导入方法依赖的package包/类
@Override
public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @NotNull ResolveState state, PsiElement lastParent, @NotNull PsiElement place){
processor.handleEvent(PsiScopeProcessor.Event.SET_DECLARATION_HOLDER, this);
return true;
}
示例14: processDeclarations
import com.intellij.psi.scope.PsiScopeProcessor; //导入方法依赖的package包/类
@Override
public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @NotNull ResolveState state, PsiElement lastParent, @NotNull PsiElement place) {
processor.handleEvent(PsiScopeProcessor.Event.SET_DECLARATION_HOLDER, this);
return lastParent == null || PsiScopesUtil.walkChildrenScopes(this, processor, state, lastParent, place);
}