本文整理匯總了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();
}