mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
inference: cache only results with default policy
completion results should not be cached even if called after resolved conflicts
This commit is contained in:
+4
-2
@@ -17,6 +17,7 @@ package com.intellij.psi.impl.source.resolve.graphInference;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.source.resolve.DefaultParameterTypeInferencePolicy;
|
||||
import com.intellij.psi.impl.source.resolve.ParameterTypeInferencePolicy;
|
||||
import com.intellij.psi.impl.source.resolve.graphInference.constraints.ExpressionCompatibilityConstraint;
|
||||
import com.intellij.psi.infos.MethodCandidateInfo;
|
||||
@@ -84,13 +85,14 @@ public class InferenceSessionContainer {
|
||||
if (topLevelCall != null) {
|
||||
|
||||
InferenceSession session;
|
||||
if (MethodCandidateInfo.isOverloadCheck() || !PsiDiamondType.ourDiamondGuard.currentStack().isEmpty() || LambdaUtil.isLambdaParameterCheck()) {
|
||||
if (MethodCandidateInfo.isOverloadCheck() || !PsiDiamondType.ourDiamondGuard.currentStack().isEmpty() ||
|
||||
LambdaUtil.isLambdaParameterCheck() || !policy.equals(DefaultParameterTypeInferencePolicy.INSTANCE)) {
|
||||
session = startTopLevelInference(topLevelCall, policy);
|
||||
}
|
||||
else {
|
||||
session = CachedValuesManager.getCachedValue(topLevelCall,
|
||||
() -> new CachedValueProvider.Result<>(
|
||||
startTopLevelInference(topLevelCall, policy),
|
||||
startTopLevelInference(topLevelCall, DefaultParameterTypeInferencePolicy.INSTANCE),
|
||||
PsiModificationTracker.MODIFICATION_COUNT));
|
||||
|
||||
if (session != null) {
|
||||
|
||||
Reference in New Issue
Block a user