Java 类com.intellij.psi.impl.source.resolve.ResolveCache 实例源码

项目:tools-idea    文件:PsiJavaCodeReferenceElementImpl.java   
@Override
@NotNull
public JavaResolveResult[] multiResolve(final boolean incompleteCode) {
  FileElement fileElement = SharedImplUtil.findFileElement(this);
  if (fileElement == null) {
    LOG.error("fileElement == null!");
    return JavaResolveResult.EMPTY_ARRAY;
  }
  final PsiManagerEx manager = fileElement.getManager();
  if (manager == null) {
    LOG.error("getManager() == null!");
    return JavaResolveResult.EMPTY_ARRAY;
  }
  PsiFile file = SharedImplUtil.getContainingFile(fileElement);
  boolean valid = file != null && file.isValid();
  if (!valid) {
    LOG.error("invalid!");
    return JavaResolveResult.EMPTY_ARRAY;
  }
  Project project = manager.getProject();

  final ResolveCache resolveCache = ResolveCache.getInstance(project);
  final ResolveResult[] results = resolveCache.resolveWithCaching(this, OurGenericsResolver.INSTANCE, true, incompleteCode, file);
  return results.length == 0 ? JavaResolveResult.EMPTY_ARRAY : (JavaResolveResult[])results;
}
项目:consulo-csharp    文件:CSharpPreprocessorReferenceExpressionImpl.java   
@RequiredReadAction
@Nullable
@Override
public PsiElement resolve()
{
    return ResolveCache.getInstance(getProject()).resolveWithCaching(this, (expression, incompleteCode) ->
    {
        Ref<CSharpPreprocessorVariable> ref = Ref.create();
        collect(it ->
        {
            if(Comparing.equal(it.getName(), getElement().getText()))
            {
                ref.set(it);
                return false;
            }
            return true;
        });
        return ref.get();
    }, true, true);
}
项目:intellij-neos    文件:FusionReferenceBase.java   
@NotNull
@Override
public ResolveResult[] multiResolve(boolean incompleteCode) {
    return ResolveCache.getInstance(myElement.getProject())
            .resolveWithCaching(this, (r, incomplete) -> {
                List<PsiElement> elements = r.resolveInner();
                List<ResolveResult> resolveResults = new ArrayList<>();
                ResolveResult[] result = new ResolveResult[elements.size()];
                for (PsiElement e: elements) {
                    resolveResults.add(new PsiElementResolveResult(e));
                }

                return resolveResults.toArray(result);
            }, true, true);
}
项目:intellij-ce-playground    文件:ClsJavaCodeReferenceElementImpl.java   
@Override
@NotNull
public JavaResolveResult[] multiResolve(boolean incompleteCode) {
  PsiFile file = getContainingFile();
  final ResolveCache resolveCache = ResolveCache.getInstance(file.getProject());
  ResolveResult[] results = resolveCache.resolveWithCaching(this, Resolver.INSTANCE, true, incompleteCode,file);
  if (results.length == 0) return JavaResolveResult.EMPTY_ARRAY;
  return (JavaResolveResult[])results;
}
项目:intellij-ce-playground    文件:PsiImportStaticReferenceElementImpl.java   
@Override
@NotNull
public JavaResolveResult[] multiResolve(boolean incompleteCode) {
  PsiFile file = getContainingFile();
  final ResolveCache resolveCache = ResolveCache.getInstance(file.getProject());
  final ResolveResult[] results = resolveCache.resolveWithCaching(this, OurGenericsResolver.INSTANCE, true, incompleteCode,file);
  return results instanceof JavaResolveResult[] ? (JavaResolveResult[])results : JavaResolveResult.EMPTY_ARRAY;
}
项目:intellij-ce-playground    文件:PsiImplUtil.java   
@NotNull
public static <T extends PsiJavaCodeReferenceElement> JavaResolveResult[] multiResolveImpl(
  @NotNull T element,
  boolean incompleteCode,
  @NotNull ResolveCache.PolyVariantContextResolver<? super T> resolver) {

  FileASTNode fileElement = SharedImplUtil.findFileElement(element.getNode());
  if (fileElement == null) {
    PsiUtilCore.ensureValid(element);
    LOG.error("fileElement == null!");
    return JavaResolveResult.EMPTY_ARRAY;
  }
  PsiFile psiFile = SharedImplUtil.getContainingFile(fileElement);
  PsiManager manager = psiFile == null ? null : psiFile.getManager();
  if (manager == null) {
    PsiUtilCore.ensureValid(element);
    LOG.error("getManager() == null!");
    return JavaResolveResult.EMPTY_ARRAY;
  }
  boolean valid = psiFile.isValid();
  if (!valid) {
    PsiUtilCore.ensureValid(element);
    LOG.error("psiFile.isValid() == false!");
    return JavaResolveResult.EMPTY_ARRAY;
  }
  if (element instanceof PsiMethodReferenceExpression) {
    // method refs: do not cache results during parent conflict resolving, acceptable checks, etc
    final Map<PsiElement, PsiType> map = LambdaUtil.ourFunctionTypes.get();
    if (map != null && map.containsKey(element)) {
      return (JavaResolveResult[])resolver.resolve(element, psiFile, incompleteCode);
    }
  }

  return multiResolveImpl(manager.getProject(), psiFile, element, incompleteCode, resolver);
}
项目:intellij-ce-playground    文件:PsiImplUtil.java   
public static <T extends PsiJavaCodeReferenceElement> JavaResolveResult[] multiResolveImpl(
  Project project,
  PsiFile psiFile,
  T element,
  boolean incompleteCode,
  ResolveCache.PolyVariantContextResolver<? super T> resolver) {

  ResolveResult[] results =
    ResolveCache.getInstance(project).resolveWithCaching(element, resolver, true, incompleteCode, psiFile);
  return results.length == 0 ? JavaResolveResult.EMPTY_ARRAY : (JavaResolveResult[])results;
}
项目:intellij-ce-playground    文件:JavaClassReference.java   
@Override
@NotNull
public JavaResolveResult advancedResolve(boolean incompleteCode) {
  PsiFile file = getJavaContextFile();
  final ResolveCache resolveCache = ResolveCache.getInstance(file.getProject());
  return (JavaResolveResult) resolveCache.resolveWithCaching(this, MyResolver.INSTANCE, false, false,file)[0];
}
项目:intellij-ce-playground    文件:PsiPolyVariantCachingReference.java   
@Override
@NotNull
public final ResolveResult[] multiResolve(boolean incompleteCode) {
  PsiElement element = getElement();
  PsiFile file = element.getContainingFile();
  return ResolveCache.getInstance(file.getProject()).resolveWithCaching(this, MyResolver.INSTANCE, true, incompleteCode,file);
}
项目:intellij-ce-playground    文件:CoreProjectEnvironment.java   
public CoreProjectEnvironment(@NotNull Disposable parentDisposable, @NotNull CoreApplicationEnvironment applicationEnvironment) {
  myParentDisposable = parentDisposable;
  myEnvironment = applicationEnvironment;
  myProject = createProject(myEnvironment.getApplication().getPicoContainer(), myParentDisposable);

  preregisterServices();

  myFileIndexFacade = createFileIndexFacade();
  myMessageBus = MessageBusFactory.newMessageBus("CoreProjectEnvironment");

  PsiModificationTrackerImpl modificationTracker = new PsiModificationTrackerImpl(myProject);
  myProject.registerService(PsiModificationTracker.class, modificationTracker);
  myProject.registerService(FileIndexFacade.class, myFileIndexFacade);
  myProject.registerService(ResolveCache.class, new ResolveCache(myMessageBus));

  myPsiManager = new PsiManagerImpl(myProject, null, null, myFileIndexFacade, myMessageBus, modificationTracker);
  ((FileManagerImpl) myPsiManager.getFileManager()).markInitialized();
  registerProjectComponent(PsiManager.class, myPsiManager);
  myProject.registerService(SmartPointerManager.class, SmartPointerManagerImpl.class);
  registerProjectComponent(PsiDocumentManager.class, new CorePsiDocumentManager(myProject, myPsiManager,
                                                                                myMessageBus,
                                                                                new MockDocumentCommitProcessor()));

  myProject.registerService(ResolveScopeManager.class, createResolveScopeManager(myPsiManager));

  myProject.registerService(PsiFileFactory.class, new PsiFileFactoryImpl(myPsiManager));
  myProject.registerService(CachedValuesManager.class, new CachedValuesManagerImpl(myProject, new PsiCachedValuesFactory(myPsiManager)));
  myProject.registerService(PsiDirectoryFactory.class, new PsiDirectoryFactoryImpl(myPsiManager));
  myProject.registerService(ProjectScopeBuilder.class, createProjectScopeBuilder());
  myProject.registerService(DumbService.class, new MockDumbService(myProject));
  myProject.registerService(CoreEncodingProjectManager.class, CoreEncodingProjectManager.class);
}
项目:intellij-ce-playground    文件:PyReferenceImpl.java   
/**
 * Resolves reference to possible referred elements.
 * First element is always what resolve() would return.
 * Imported module names: to module file, or {directory, '__init__.py}' for a qualifier.
 * todo Local identifiers: a list of definitions in the most recent compound statement
 * (e.g. <code>if X: a = 1; else: a = 2</code> has two definitions of <code>a</code>.).
 * todo Identifiers not found locally: similar definitions in imported files and builtins.
 *
 * @see com.intellij.psi.PsiPolyVariantReference#multiResolve(boolean)
 */
@Override
@NotNull
public ResolveResult[] multiResolve(final boolean incompleteCode) {
  if (USE_CACHE) {
    final ResolveCache cache = ResolveCache.getInstance(getElement().getProject());
    return cache.resolveWithCaching(this, CachingResolver.INSTANCE, false, incompleteCode);
  }
  else {
    return multiResolveInner();
  }
}
项目:intellij-ce-playground    文件:TypeOrElementOrAttributeReference.java   
@Override
@Nullable
public PsiElement resolve() {
  final PsiElement psiElement = ResolveCache
    .getInstance(getElement().getProject()).resolveWithCaching(this, MyResolver.INSTANCE, false, false);

  return psiElement != PsiUtilCore.NULL_PSI_ELEMENT ? psiElement:null;
}
项目:intellij-ce-playground    文件:AndroidXmlReferenceProvider.java   
@Override
public PsiElement resolve() {
  return ResolveCache.getInstance(myElement.getProject()).resolveWithCaching(this, new ResolveCache.Resolver() {
    @Nullable
    @Override
    public PsiElement resolve(@NotNull PsiReference reference, boolean incompleteCode) {
      return resolveInner();
    }
  }, false, false);
}
项目:intellij-ce-playground    文件:ConstantFieldConverter.java   
@Nullable
@Override
public PsiElement resolve() {
  return ResolveCache.getInstance(myElement.getProject()).resolveWithCaching(this, new ResolveCache.Resolver() {
    @Nullable
    @Override
    public PsiElement resolve(@NotNull PsiReference reference, boolean incompleteCode) {
      return resolveInner();
    }
  }, false, false);
}
项目:intellij-ce-playground    文件:InstrumentationTargetPackageConverter.java   
@Nullable
@Override
public PsiElement resolve() {
  return ResolveCache.getInstance(myElement.getProject())
    .resolveWithCaching(this, new ResolveCache.Resolver() {
      @Override
      public PsiElement resolve(@NotNull PsiReference reference, boolean incompleteCode) {
        return resolveInner();
      }
    }, false, false);
}
项目:intellij-ce-playground    文件:PackageClassConverter.java   
@Override
public PsiElement resolve() {
  return ResolveCache.getInstance(myElement.getProject()).resolveWithCaching(this, new ResolveCache.Resolver() {
      @Nullable
      @Override
      public PsiElement resolve(@NotNull PsiReference reference, boolean incompleteCode) {
        return resolveInner();
      }
    }, false, false);
}
项目:intellij-ce-playground    文件:InferenceContext.java   
@Override
public <T extends PsiPolyVariantReference> GroovyResolveResult[] multiResolve(@NotNull T ref,
                                                                              boolean incomplete,
                                                                              ResolveCache.PolyVariantResolver<T> resolver) {
  ResolveResult[] results = ResolveCache.getInstance(ref.getElement().getProject()).resolveWithCaching(ref, resolver, true, incomplete);
  return results.length == 0 ? GroovyResolveResult.EMPTY_ARRAY : (GroovyResolveResult[])results;
}
项目:intellij-ce-playground    文件:InferenceContext.java   
@NotNull
@Override
public <T extends PsiPolyVariantReference> GroovyResolveResult[] multiResolve(@NotNull final T ref,
                                                                              final boolean incomplete,
                                                                              @NotNull final ResolveCache.PolyVariantResolver<T> resolver) {
  return _getCachedValue(ref.getElement(), new Computable<GroovyResolveResult[]>() {
    @Override
    public GroovyResolveResult[] compute() {
      return (GroovyResolveResult[])resolver.resolve(ref, incomplete);
    }
  }, Pair.create(incomplete, resolver.getClass()));
}
项目:intellij-ce-playground    文件:SimpleAttributeReference.java   
@Nullable
public final PsiElement resolve() {
    return ResolveCache.getInstance(myAttribute.getProject()).resolveWithCaching(this, new ResolveCache.Resolver() {
        @Nullable
        public PsiElement resolve(@NotNull PsiReference psiReference, boolean b) {
            return resolveImpl();
        }
    }, false, false);
}
项目:DLangPlugin    文件:DLangReferenceImpl.java   
@NotNull
@Override
public ResolveResult[] multiResolve(boolean incompleteCode) {
    final List<? extends PsiElement> elements =
            ResolveCache.getInstance(getProject()).resolveWithCaching(this, DLangResolver.INSTANCE, true, incompleteCode);
    return toCandidateInfoArray(elements);
}
项目:tools-idea    文件:ClsJavaCodeReferenceElementImpl.java   
@Override
@NotNull
public JavaResolveResult[] multiResolve(boolean incompleteCode) {
  PsiFile file = getContainingFile();
  final ResolveCache resolveCache = ResolveCache.getInstance(file.getProject());
  ResolveResult[] results = resolveCache.resolveWithCaching(this, Resolver.INSTANCE, true, incompleteCode,file);
  if (results.length == 0) return JavaResolveResult.EMPTY_ARRAY;
  return (JavaResolveResult[])results;
}
项目:tools-idea    文件:PsiImportStaticReferenceElementImpl.java   
@Override
@NotNull
public JavaResolveResult[] multiResolve(boolean incompleteCode) {
  PsiFile file = getContainingFile();
  final ResolveCache resolveCache = ResolveCache.getInstance(file.getProject());
  final ResolveResult[] results = resolveCache.resolveWithCaching(this, OurGenericsResolver.INSTANCE, true, incompleteCode,file);
  return results instanceof JavaResolveResult[] ? (JavaResolveResult[])results : JavaResolveResult.EMPTY_ARRAY;
}
项目:tools-idea    文件:PsiMethodReferenceExpressionImpl.java   
@NotNull
@Override
public JavaResolveResult[] multiResolve(final boolean incompleteCode) {
  FileElement fileElement = SharedImplUtil.findFileElement(this);
  if (fileElement == null) {
    LOG.error("fileElement == null!");
    return JavaResolveResult.EMPTY_ARRAY;
  }
  final PsiManagerEx manager = fileElement.getManager();
  if (manager == null) {
    LOG.error("getManager() == null!");
    return JavaResolveResult.EMPTY_ARRAY;
  }
  PsiFile file = SharedImplUtil.getContainingFile(fileElement);
  boolean valid = file != null && file.isValid();
  if (!valid) {
    LOG.error("invalid!");
    return JavaResolveResult.EMPTY_ARRAY;
  }
  final MethodReferenceResolver resolver = new MethodReferenceResolver();
  final Map<PsiMethodReferenceExpression, PsiType> map = PsiMethodReferenceUtil.ourRefs.get();
  if (map != null && map.containsKey(this)) {
    return (JavaResolveResult[])resolver.resolve(this, incompleteCode);
  }
  ResolveResult[] results = ResolveCache.getInstance(getProject()).resolveWithCaching(this, resolver, true, incompleteCode,file);
  return results.length == 0 ? JavaResolveResult.EMPTY_ARRAY : (JavaResolveResult[])results;
}
项目:tools-idea    文件:JavaClassReference.java   
@Override
@NotNull
public JavaResolveResult advancedResolve(boolean incompleteCode) {
  PsiFile file = getElement().getContainingFile();
  final ResolveCache resolveCache = ResolveCache.getInstance(file.getProject());
  return (JavaResolveResult) resolveCache.resolveWithCaching(this, MyResolver.INSTANCE, false, false,file)[0];
}
项目:tools-idea    文件:PsiPolyVariantCachingReference.java   
@Override
@NotNull
public final ResolveResult[] multiResolve(boolean incompleteCode) {
  PsiElement element = getElement();
  PsiFile file = element.getContainingFile();
  return ResolveCache.getInstance(file.getProject()).resolveWithCaching(this, MyResolver.INSTANCE, true, incompleteCode,file);
}
项目:tools-idea    文件:CoreProjectEnvironment.java   
public CoreProjectEnvironment(Disposable parentDisposable, CoreApplicationEnvironment applicationEnvironment) {
  myParentDisposable = parentDisposable;
  myEnvironment = applicationEnvironment;
  myProject = new MockProject(myEnvironment.getApplication().getPicoContainer(), myParentDisposable);

  preregisterServices();

  myFileIndexFacade = createFileIndexFacade();
  myMessageBus = new MessageBusImpl("CoreProjectEnvironment", null);

  PsiModificationTrackerImpl modificationTracker = new PsiModificationTrackerImpl(myProject);
  myProject.registerService(PsiModificationTracker.class, modificationTracker);
  myProject.registerService(FileIndexFacade.class, myFileIndexFacade);
  myProject.registerService(ResolveCache.class, new ResolveCache(myMessageBus));

  registerProjectExtensionPoint(PsiTreeChangePreprocessor.EP_NAME, PsiTreeChangePreprocessor.class);
  myPsiManager = new PsiManagerImpl(myProject, null, null, myFileIndexFacade, myMessageBus, modificationTracker);
  ((FileManagerImpl) myPsiManager.getFileManager()).markInitialized();
  registerProjectComponent(PsiManager.class, myPsiManager);

  myProject.registerService(ResolveScopeManager.class, createResolveScopeManager(myPsiManager));

  myProject.registerService(PsiFileFactory.class, new PsiFileFactoryImpl(myPsiManager));
  myProject.registerService(CachedValuesManager.class, new CachedValuesManagerImpl(myProject, new PsiCachedValuesFactory(myPsiManager)));
  myProject.registerService(PsiDirectoryFactory.class, new PsiDirectoryFactoryImpl(myPsiManager));
  myProject.registerService(ProjectScopeBuilder.class, createProjectScopeBuilder());
  myProject.registerService(DumbService.class, new MockDumbService(myProject));
}
项目:tools-idea    文件:InferenceContext.java   
@Override
public <T extends PsiPolyVariantReference> GroovyResolveResult[] multiResolve(@NotNull T ref,
                                                                              boolean incomplete,
                                                                              ResolveCache.PolyVariantResolver<T> resolver) {
  ResolveResult[] results = ResolveCache.getInstance(ref.getElement().getProject()).resolveWithCaching(ref, resolver, true, incomplete);
  return results.length == 0 ? GroovyResolveResult.EMPTY_ARRAY : (GroovyResolveResult[])results;
}
项目:tools-idea    文件:InferenceContext.java   
@NotNull
@Override
public <T extends PsiPolyVariantReference> GroovyResolveResult[] multiResolve(@NotNull final T ref,
                                                                              final boolean incomplete,
                                                                              @NotNull final ResolveCache.PolyVariantResolver<T> resolver) {
  return _getCachedValue(ref.getElement(), new Computable<GroovyResolveResult[]>() {
    @Override
    public GroovyResolveResult[] compute() {
      return (GroovyResolveResult[])resolver.resolve(ref, incomplete);
    }
  }, Pair.create(incomplete, resolver.getClass()));
}
项目:tools-idea    文件:SimpleAttributeReference.java   
@Nullable
public final PsiElement resolve() {
    return ResolveCache.getInstance(myAttribute.getProject()).resolveWithCaching(this, new ResolveCache.Resolver() {
        @Nullable
        public PsiElement resolve(@NotNull PsiReference psiReference, boolean b) {
            return resolveImpl();
        }
    }, false, false);
}
项目:consulo-csharp    文件:CSharpReferenceExpressionImplUtil.java   
@RequiredReadAction
@NotNull
public static ResolveResult[] multiResolve(CSharpReferenceExpressionEx expression, final boolean incompleteCode, final boolean resolveFromParent)
{
    if(!expression.isValid())
    {
        return ResolveResult.EMPTY_ARRAY;
    }

    ResolveResult[] resolveResults;
    CSharpReferenceExpressionImplUtil.OurResolver resolver = CSharpReferenceExpressionImplUtil.OurResolver.INSTANCE;
    if(GenericInferenceUtil.isInsideGenericInferenceSession())
    {
        resolveResults = resolver.resolve(expression, resolveFromParent);
    }
    else
    {
        resolveResults = ResolveCache.getInstance(expression.getProject()).resolveWithCaching(expression, resolver, false, resolveFromParent);
    }

    if(!incompleteCode)
    {
        return resolveResults;
    }
    else
    {
        return CSharpResolveUtil.filterValidResults(resolveResults);
    }
}
项目:consulo-csharp    文件:CSharpIndexAccessExpressionImpl.java   
@NotNull
@Override
@RequiredReadAction
public ResolveResult[] multiResolve(boolean incompleteCode)
{
    if(GenericInferenceUtil.isInsideGenericInferenceSession())
    {
        return OurResolver.INSTANCE.resolve(this, incompleteCode);
    }
    return ResolveCache.getInstance(getProject()).resolveWithCaching(this, OurResolver.INSTANCE, true, incompleteCode);
}
项目:consulo-csharp    文件:CSharpOperatorReferenceImpl.java   
@RequiredReadAction
@NotNull
@Override
public ResolveResult[] multiResolve(boolean incompleteCode)
{
    return ResolveCache.getInstance(getProject()).resolveWithCaching(this, OurResolver.INSTANCE, false, incompleteCode);
}
项目:consulo-haxe    文件:HaxeReferenceImpl.java   
@NotNull
@Override
public ResolveResult[] multiResolve(boolean incompleteCode)
{
    final List<? extends PsiElement> elements = ResolveCache.getInstance(getProject()).resolveWithCaching(this, HaxeResolver.INSTANCE, true,
            incompleteCode);
    return toCandidateInfoArray(elements);
}
项目:consulo    文件:PsiPolyVariantCachingReference.java   
@Override
@Nonnull
public final ResolveResult[] multiResolve(boolean incompleteCode) {
  PsiElement element = getElement();
  PsiFile file = element.getContainingFile();
  return ResolveCache.getInstance(file.getProject()).resolveWithCaching(this, MyResolver.INSTANCE, true, incompleteCode,file);
}
项目:consulo    文件:CoreProjectEnvironment.java   
public CoreProjectEnvironment(Disposable parentDisposable, CoreApplicationEnvironment applicationEnvironment) {
  myParentDisposable = parentDisposable;
  myEnvironment = applicationEnvironment;
  myProject = new MockProject(myEnvironment.getApplication().getPicoContainer(), myParentDisposable);

  preregisterServices();

  myFileIndexFacade = createFileIndexFacade();
  myMessageBus = (MessageBusImpl)myProject.getMessageBus();

  PsiModificationTrackerImpl modificationTracker = new PsiModificationTrackerImpl(myProject);
  myProject.registerService(PsiModificationTracker.class, modificationTracker);
  myProject.registerService(FileIndexFacade.class, myFileIndexFacade);
  myProject.registerService(ResolveCache.class, new ResolveCache(myMessageBus));

  registerProjectExtensionPoint(PsiTreeChangePreprocessor.EP_NAME, PsiTreeChangePreprocessor.class);
  myPsiManager = new PsiManagerImpl(myProject, null, null, myFileIndexFacade, myMessageBus, modificationTracker);
  ((FileManagerImpl)myPsiManager.getFileManager()).markInitialized();
  registerProjectComponent(PsiManager.class, myPsiManager);

  registerProjectComponent(PsiDocumentManager.class, new CorePsiDocumentManager(myProject, myPsiManager, myMessageBus, new MockDocumentCommitProcessor()));

  myProject.registerService(ResolveScopeManager.class, createResolveScopeManager(myPsiManager));

  myProject.registerService(PsiFileFactory.class, new PsiFileFactoryImpl(myPsiManager));
  myProject.registerService(CachedValuesManager.class, new CachedValuesManagerImpl(myProject, new PsiCachedValuesFactory(myPsiManager)));
  myProject.registerService(ProjectScopeBuilder.class, createProjectScopeBuilder());
  myProject.registerService(DumbService.class, new MockDumbService(myProject));
}
项目:consulo-xslt    文件:SimpleAttributeReference.java   
@Nullable
public final PsiElement resolve() {
    return ResolveCache.getInstance(myAttribute.getProject()).resolveWithCaching(this, new ResolveCache.Resolver() {
        @Nullable
        public PsiElement resolve(@NotNull PsiReference psiReference, boolean b) {
            return resolveImpl();
        }
    }, false, false);
}
项目:consulo-xml    文件:TypeOrElementOrAttributeReference.java   
@Override
@Nullable
public PsiElement resolve()
{
    final PsiElement psiElement = ResolveCache.getInstance(getElement().getProject()).resolveWithCaching(this, MyResolver.INSTANCE, false, false);

    return psiElement != PsiUtilCore.NULL_PSI_ELEMENT ? psiElement : null;
}
项目:consulo-javascript    文件:JSReferenceSet.java   
@Override
@NotNull
@RequiredReadAction
public ResolveResult[] multiResolve(final boolean incompleteCode)
{
    PsiFile containingFile = element.getContainingFile();
    if(containingFile == null)
    {
        return ResolveResult.EMPTY_ARRAY;
    }
    return ResolveCache.getInstance(containingFile.getProject()).resolveWithCaching(this, MyResolver.INSTANCE, true, incompleteCode, containingFile);
}
项目:consulo-java    文件:ClsJavaCodeReferenceElementImpl.java   
@Override
@NotNull
public JavaResolveResult[] multiResolve(boolean incompleteCode)
{
    PsiFile file = getContainingFile();
    final ResolveCache resolveCache = ResolveCache.getInstance(file.getProject());
    ResolveResult[] results = resolveCache.resolveWithCaching(this, Resolver.INSTANCE, true, incompleteCode, file);
    if(results.length == 0)
    {
        return JavaResolveResult.EMPTY_ARRAY;
    }
    return (JavaResolveResult[]) results;
}
项目:consulo-java    文件:PsiImportStaticReferenceElementImpl.java   
@Override
@NotNull
public JavaResolveResult[] multiResolve(boolean incompleteCode) {
  PsiFile file = getContainingFile();
  final ResolveCache resolveCache = ResolveCache.getInstance(file.getProject());
  final ResolveResult[] results = resolveCache.resolveWithCaching(this, OurGenericsResolver.INSTANCE, true, incompleteCode,file);
  return results instanceof JavaResolveResult[] ? (JavaResolveResult[])results : JavaResolveResult.EMPTY_ARRAY;
}