本文整理汇总了Java中com.intellij.psi.impl.source.tree.java.PsiLocalVariableImpl类的典型用法代码示例。如果您正苦于以下问题:Java PsiLocalVariableImpl类的具体用法?Java PsiLocalVariableImpl怎么用?Java PsiLocalVariableImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PsiLocalVariableImpl类属于com.intellij.psi.impl.source.tree.java包,在下文中一共展示了PsiLocalVariableImpl类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findInitializerType
import com.intellij.psi.impl.source.tree.java.PsiLocalVariableImpl; //导入依赖的package包/类
private PsiType findInitializerType( PsiElement firstElem )
{
PsiElement csr = firstElem;
while( csr != null && !(csr instanceof PsiLocalVariableImpl) )
{
csr = csr.getParent();
}
if( csr instanceof PsiLocalVariableImpl )
{
PsiExpression initializer = ((PsiLocalVariableImpl)csr).getInitializer();
return initializer == null ? null : initializer.getType();
}
return null;
}
示例2: execute
import com.intellij.psi.impl.source.tree.java.PsiLocalVariableImpl; //导入依赖的package包/类
@Override
public boolean execute(@NotNull PsiElement element, @NotNull ResolveState state) {
if (element instanceof PsiLocalVariableImpl) { //todo a better hack
return true; // the debugger creates a Java code block context and our expressions to evaluate resolve there
}
if (myResolveTargetKinds.contains(getResolveKind(element))) {
//hack for resolve of java local vars and parameters
//don't check field for name because they can be aliased imported
if (element instanceof PsiVariable && !(element instanceof PsiField) &&
getName() != null && !getName().equals(((PsiVariable)element).getName())) {
return true;
}
PsiNamedElement namedElement = (PsiNamedElement)element;
PsiSubstitutor substitutor = state.get(PsiSubstitutor.KEY);
if (substitutor == null) substitutor = PsiSubstitutor.EMPTY;
if (myTypeArguments.length > 0 && namedElement instanceof PsiClass) {
substitutor = substitutor.putAll((PsiClass)namedElement, myTypeArguments);
}
if (namedElement instanceof PsiClass && !(namedElement instanceof PsiTypeParameter)) {
final PsiClass aClass = (PsiClass)namedElement;
if (myProcessedClasses == null) myProcessedClasses = new HashSet<String>();
if (!myProcessedClasses.add(aClass.getQualifiedName())) {
return true;
}
}
boolean isAccessible = isAccessible(namedElement);
final PsiElement resolveContext = state.get(RESOLVE_CONTEXT);
final SpreadState spreadState = state.get(SpreadState.SPREAD_STATE);
boolean isStaticsOK = isStaticsOK(namedElement, resolveContext, false);
addCandidate(new GroovyResolveResultImpl(namedElement, resolveContext, spreadState, substitutor, isAccessible, isStaticsOK));
return !(isAccessible && isStaticsOK);
}
return true;
}
示例3: execute
import com.intellij.psi.impl.source.tree.java.PsiLocalVariableImpl; //导入依赖的package包/类
public boolean execute(@NotNull PsiElement element, @NotNull ResolveState state) {
if (element instanceof PsiLocalVariableImpl) { //todo a better hack
return true; // the debugger creates a Java code block context and our expressions to evaluate resolve there
}
if (myResolveTargetKinds.contains(getResolveKind(element))) {
//hack for resolve of java local vars and parameters
//don't check field for name because they can be aliased imported
if (element instanceof PsiVariable && !(element instanceof PsiField) &&
myName != null && !myName.equals(((PsiVariable)element).getName())) {
return true;
}
PsiNamedElement namedElement = (PsiNamedElement)element;
PsiSubstitutor substitutor = state.get(PsiSubstitutor.KEY);
if (substitutor == null) substitutor = PsiSubstitutor.EMPTY;
if (myTypeArguments.length > 0 && namedElement instanceof PsiClass) {
substitutor = substitutor.putAll((PsiClass)namedElement, myTypeArguments);
}
if (namedElement instanceof PsiClass && !(namedElement instanceof PsiTypeParameter)) {
final PsiClass aClass = (PsiClass)namedElement;
if (myProcessedClasses == null) myProcessedClasses = new HashSet<String>();
if (!myProcessedClasses.add(aClass.getQualifiedName())) {
return true;
}
}
boolean isAccessible = isAccessible(namedElement);
final PsiElement resolveContext = state.get(RESOLVE_CONTEXT);
final SpreadState spreadState = state.get(SpreadState.SPREAD_STATE);
boolean isStaticsOK = isStaticsOK(namedElement, resolveContext, true);
addCandidate(new GroovyResolveResultImpl(namedElement, resolveContext, spreadState, substitutor, isAccessible, isStaticsOK));
return !(isAccessible && isStaticsOK);
}
return true;
}