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


Java PsiTreeUtil.treeWalkUp方法代码示例

本文整理汇总了Java中com.intellij.psi.util.PsiTreeUtil.treeWalkUp方法的典型用法代码示例。如果您正苦于以下问题:Java PsiTreeUtil.treeWalkUp方法的具体用法?Java PsiTreeUtil.treeWalkUp怎么用?Java PsiTreeUtil.treeWalkUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.psi.util.PsiTreeUtil的用法示例。


在下文中一共展示了PsiTreeUtil.treeWalkUp方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: resolveSimpleReference

import com.intellij.psi.util.PsiTreeUtil; //导入方法依赖的package包/类
private List<? extends PsiElement> resolveSimpleReference(@NotNull final PsiElement scopeElement, @NotNull final String name) {
  final List<PsiElement> result = new ArrayList<>();

  final AppleScriptResolveProcessor resolveProcessor = new AppleScriptResolveProcessor(name);
  PsiTreeUtil.treeWalkUp(resolveProcessor, scopeElement, null, ResolveState.initial());
  result.add(resolveProcessor.getResult());
  return result;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:9,代码来源:AppleScriptResolver.java

示例2: resolve

import com.intellij.psi.util.PsiTreeUtil; //导入方法依赖的package包/类
@Override
public List<? extends PsiElement> resolve(@NotNull AppleScriptReferenceElement scopeElement, boolean incompleteCode) {
  final Set<AppleScriptComponent> resultSet = new HashSet<>();

  // local
  PsiElement maxScope = getMaxScope(scopeElement);
  final AppleScriptComponentScopeProcessor resolveProcessor = new AppleScriptComponentScopeProcessor(resultSet);
  PsiTreeUtil.treeWalkUp(resolveProcessor, scopeElement, maxScope, ResolveState.initial());
  return new ArrayList<>(resultSet);
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:11,代码来源:AppleScriptComponentScopeResolver.java

示例3: resolveInner

import com.intellij.psi.util.PsiTreeUtil; //导入方法依赖的package包/类
@NotNull
  @Override
  protected ResolveResult[] resolveInner(boolean incompleteCode, @NotNull PsiFile containingFile) {
    final AppleScriptDictionaryResolveProcessor resolveProcessor = new AppleScriptDictionaryResolveProcessor(getElement(), getCanonicalText());
    List<PsiElement> maxScope = AppleScriptResolveUtil.getTellStatementResolveScope(getElement());
    final List<PsiElement> res = new ArrayList<>();
    DictionaryComponent resolveResult;
    if (!maxScope.isEmpty()) {
      for (PsiElement el : maxScope) {
//      maxTellScope = maxTellScope==null ? el : el.getTextOffset() > maxTellScope.getTextOffset() ? maxTellScope : el;
        PsiTreeUtil.treeWalkUp(resolveProcessor, getElement(), el, ResolveState.initial());
        resolveResult = resolveProcessor.getMyResult();
        if (resolveResult != null) {
          res.add(resolveResult);
          break;
        }
      }
    }
    if (res.isEmpty()) {//if search with
      PsiTreeUtil.treeWalkUp(resolveProcessor, getElement(), null, ResolveState.initial());
      resolveResult = resolveProcessor.getMyResult();
      if (resolveResult != null) {
        res.add(resolveResult);
      }
    }
    return AppleScriptResolveUtil.toCandidateInfoArray(res);
  }
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:28,代码来源:AbstractDictionaryReferenceElement.java

示例4: resolveInner

import com.intellij.psi.util.PsiTreeUtil; //导入方法依赖的package包/类
@NotNull
@Override
protected ResolveResult[] resolveInner(boolean incompleteCode, @NotNull PsiFile containingFile) {
  final AppleScriptResolveProcessor resolveProcessor = new AppleScriptResolveProcessor(getHandlerSelector());
  PsiTreeUtil.treeWalkUp(resolveProcessor, AbstractAppleScriptHandlerCall.this, null, ResolveState.initial());
  final List<PsiElement> results = new ArrayList<>();
  results.add(resolveProcessor.getResult());
  return AppleScriptResolveUtil.toCandidateInfoArray(results);
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:10,代码来源:AbstractAppleScriptHandlerCall.java


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