Java 类com.intellij.psi.impl.source.tree.java.PsiLocalVariableImpl 实例源码

项目:manifold-ij    文件:ManHighlightInfoFilter.java   
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;
}
项目:intellij-ce-playground    文件:ResolverProcessor.java   
@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;
}
项目:tools-idea    文件:ResolverProcessor.java   
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;
}