当前位置: 首页>>代码示例>>Java>>正文


Java PsiLocalVariableImpl类代码示例

本文整理汇总了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;
}
 
开发者ID:manifold-systems,项目名称:manifold-ij,代码行数:15,代码来源:ManHighlightInfoFilter.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:40,代码来源:ResolverProcessor.java

示例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;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:39,代码来源:ResolverProcessor.java


注:本文中的com.intellij.psi.impl.source.tree.java.PsiLocalVariableImpl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。