本文整理汇总了Java中com.intellij.psi.impl.source.resolve.CompletionParameterTypeInferencePolicy类的典型用法代码示例。如果您正苦于以下问题:Java CompletionParameterTypeInferencePolicy类的具体用法?Java CompletionParameterTypeInferencePolicy怎么用?Java CompletionParameterTypeInferencePolicy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CompletionParameterTypeInferencePolicy类属于com.intellij.psi.impl.source.resolve包,在下文中一共展示了CompletionParameterTypeInferencePolicy类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: inferSubstitutor
import com.intellij.psi.impl.source.resolve.CompletionParameterTypeInferencePolicy; //导入依赖的package包/类
@Nullable
public static PsiSubstitutor inferSubstitutor(final PsiMethod method, final PsiMethodCallExpression callExpr, boolean forCompletion) {
final PsiResolveHelper helper = JavaPsiFacade.getInstance(method.getProject()).getResolveHelper();
final PsiParameter[] parameters = method.getParameterList().getParameters();
PsiExpression[] args = callExpr.getArgumentList().getExpressions();
PsiSubstitutor result = PsiSubstitutor.EMPTY;
for (PsiTypeParameter typeParameter : PsiUtil.typeParametersIterable(method.getContainingClass())) {
PsiType type = helper.inferTypeForMethodTypeParameter(typeParameter, parameters, args, PsiSubstitutor.EMPTY, callExpr.getParent(),
forCompletion ? CompletionParameterTypeInferencePolicy.INSTANCE : DefaultParameterTypeInferencePolicy.INSTANCE);
if (PsiType.NULL.equals(type)) return null;
result = result.put(typeParameter, type);
}
return result;
}
示例2: getCandidateInfoSubstitutor
import com.intellij.psi.impl.source.resolve.CompletionParameterTypeInferencePolicy; //导入依赖的package包/类
private static PsiSubstitutor getCandidateInfoSubstitutor(CandidateInfo candidate) {
return candidate instanceof MethodCandidateInfo && ((MethodCandidateInfo)candidate).isInferencePossible()
? ((MethodCandidateInfo)candidate).inferTypeArguments(CompletionParameterTypeInferencePolicy.INSTANCE, true)
: candidate.getSubstitutor();
}
示例3: getCandidateInfoSubstitutor
import com.intellij.psi.impl.source.resolve.CompletionParameterTypeInferencePolicy; //导入依赖的package包/类
private static PsiSubstitutor getCandidateInfoSubstitutor(CandidateInfo candidate) {
return candidate instanceof MethodCandidateInfo && ((MethodCandidateInfo)candidate).isInferencePossible()
? ((MethodCandidateInfo)candidate).inferTypeArguments(CompletionParameterTypeInferencePolicy.INSTANCE)
: candidate.getSubstitutor();
}
示例4: getCandidateInfoSubstitutor
import com.intellij.psi.impl.source.resolve.CompletionParameterTypeInferencePolicy; //导入依赖的package包/类
private static PsiSubstitutor getCandidateInfoSubstitutor(CandidateInfo candidate)
{
return candidate instanceof MethodCandidateInfo && ((MethodCandidateInfo) candidate).isInferencePossible() ? ((MethodCandidateInfo) candidate).inferTypeArguments
(CompletionParameterTypeInferencePolicy.INSTANCE, true) : candidate.getSubstitutor();
}