コード例 #1
0
  public void updateParameterInfo(@NotNull PsiElement place, UpdateParameterInfoContext context) {
    if (context.getParameterOwner() == null) {
      context.setParameterOwner(place);
    } else if (!context.getParameterOwner().equals(place)) {
      context.removeHint();
      return;
    }
    final Object[] objects = context.getObjectsToView();

    for (int i = 0; i < objects.length; i++) {
      context.setUIComponentEnabled(i, true);
    }
  }
コード例 #2
0
  @Override
  public void updateParameterInfo(@NotNull PsiElement place, UpdateParameterInfoContext context) {
    int parameterIndex = DartResolveUtil.getArgumentIndex(place);
    context.setCurrentParameter(parameterIndex);

    if (context.getParameterOwner() == null) {
      context.setParameterOwner(place);
    } else if (context.getParameterOwner()
        != PsiTreeUtil.getParentOfType(place, DartCallExpression.class, DartNewExpression.class)) {
      context.removeHint();
      return;
    }
    final Object[] objects = context.getObjectsToView();

    for (int i = 0; i < objects.length; i++) {
      context.setUIComponentEnabled(i, true);
    }
  }
コード例 #3
0
 @Override
 public void updateParameterInfo(
     @NotNull JetValueArgumentList argumentList, @NotNull UpdateParameterInfoContext context) {
   if (context.getParameterOwner() != argumentList) context.removeHint();
   int offset = context.getOffset();
   ASTNode child = argumentList.getNode().getFirstChildNode();
   int i = 0;
   while (child != null && child.getStartOffset() < offset) {
     if (child.getElementType() == JetTokens.COMMA) ++i;
     child = child.getTreeNext();
   }
   context.setCurrentParameter(i);
 }