@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; }
@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; }
@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; }
@NotNull private JavaResolveResult[] resolveToVariable(@NotNull PsiFile containingFile) { final VariableResolverProcessor processor = new VariableResolverProcessor(this, containingFile); PsiScopesUtil.resolveAndWalk(processor, this, null); return processor.getResult(); }