本文整理汇总了Java中com.intellij.psi.impl.source.resolve.JavaResolveUtil.substituteResults方法的典型用法代码示例。如果您正苦于以下问题:Java JavaResolveUtil.substituteResults方法的具体用法?Java JavaResolveUtil.substituteResults怎么用?Java JavaResolveUtil.substituteResults使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.psi.impl.source.resolve.JavaResolveUtil
的用法示例。
在下文中一共展示了JavaResolveUtil.substituteResults方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolve
import com.intellij.psi.impl.source.resolve.JavaResolveUtil; //导入方法依赖的package包/类
@NotNull
@Override
public ResolveResult[] resolve(@NotNull PsiJavaReference ref, @NotNull PsiFile containingFile, boolean incompleteCode) {
PsiJavaCodeReferenceElementImpl referenceElement = (PsiJavaCodeReferenceElementImpl)ref;
int kind = referenceElement.getKind(containingFile);
JavaResolveResult[] result = referenceElement.resolve(kind, containingFile);
if (incompleteCode && result.length == 0 && kind != CLASS_FQ_NAME_KIND && kind != CLASS_FQ_OR_PACKAGE_NAME_KIND) {
VariableResolverProcessor processor = new VariableResolverProcessor(referenceElement, containingFile);
PsiScopesUtil.resolveAndWalk(processor, referenceElement, null, true);
result = processor.getResult();
if (result.length == 0 && kind == CLASS_NAME_KIND) {
result = referenceElement.resolve(PACKAGE_NAME_KIND, containingFile);
}
}
JavaResolveUtil.substituteResults(referenceElement, result);
return result;
}
示例2: resolve
import com.intellij.psi.impl.source.resolve.JavaResolveUtil; //导入方法依赖的package包/类
@NotNull
@Override
public JavaResolveResult[] resolve(@NotNull PsiJavaReference ref, boolean incompleteCode) {
PsiJavaCodeReferenceElementImpl referenceElement = (PsiJavaCodeReferenceElementImpl)ref;
int kind = referenceElement.getKind();
PsiFile containingFile = referenceElement.getContainingFile();
JavaResolveResult[] result = referenceElement.resolve(kind, containingFile);
if (incompleteCode && result.length == 0 && kind != CLASS_FQ_NAME_KIND && kind != CLASS_FQ_OR_PACKAGE_NAME_KIND) {
VariableResolverProcessor processor = new VariableResolverProcessor(referenceElement, containingFile);
PsiScopesUtil.resolveAndWalk(processor, referenceElement, null, incompleteCode);
result = processor.getResult();
if (result.length == 0 && kind == CLASS_NAME_KIND) {
result = referenceElement.resolve(PACKAGE_NAME_KIND, containingFile);
}
}
JavaResolveUtil.substituteResults((PsiJavaCodeReferenceElement)ref, result);
return result;
}
示例3: resolve
import com.intellij.psi.impl.source.resolve.JavaResolveUtil; //导入方法依赖的package包/类
@NotNull
@Override
public ResolveResult[] resolve(@NotNull PsiJavaReference ref, @NotNull PsiFile containingFile, boolean incompleteCode)
{
PsiJavaCodeReferenceElementImpl referenceElement = (PsiJavaCodeReferenceElementImpl) ref;
int kind = referenceElement.getKind(containingFile);
JavaResolveResult[] result = referenceElement.resolve(kind, containingFile);
if(incompleteCode && result.length == 0 && kind != CLASS_FQ_NAME_KIND && kind != CLASS_FQ_OR_PACKAGE_NAME_KIND)
{
VariableResolverProcessor processor = new VariableResolverProcessor(referenceElement, containingFile);
PsiScopesUtil.resolveAndWalk(processor, referenceElement, null, true);
result = processor.getResult();
if(result.length == 0 && kind == CLASS_NAME_KIND)
{
result = referenceElement.resolve(PACKAGE_NAME_KIND, containingFile);
}
}
JavaResolveUtil.substituteResults(referenceElement, result);
return result;
}
示例4: resolve
import com.intellij.psi.impl.source.resolve.JavaResolveUtil; //导入方法依赖的package包/类
@NotNull
@Override
public ResolveResult[] resolve(@NotNull PsiJavaReference ref, @NotNull PsiFile containingFile, boolean incompleteCode)
{
PsiReferenceExpressionImpl expression = (PsiReferenceExpressionImpl) ref;
CompositeElement treeParent = expression.getTreeParent();
IElementType parentType = treeParent == null ? null : treeParent.getElementType();
List<ResolveResult[]> qualifiers = resolveAllQualifiers(expression, containingFile);
JavaResolveResult[] result = expression.resolve(parentType, containingFile);
if(result.length == 0 && incompleteCode && parentType != JavaElementType.REFERENCE_EXPRESSION)
{
result = expression.resolve(JavaElementType.REFERENCE_EXPRESSION, containingFile);
}
JavaResolveUtil.substituteResults(expression, result);
qualifiers.clear(); // hold qualifier target list until this moment to avoid psi elements inside to GC
return result;
}