本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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);
}