@Override public void updateParameterInfo(@NotNull PsiElement place, UpdateParameterInfoContext context) { CSharpCallArgumentListOwner owner = resolveCallArgumentListOwner(place); int parameterIndex = -1; CSharpCallArgumentList callArgumentList = owner == null ? null : owner.getParameterList(); if(callArgumentList != null) { IElementType delimiter = CSharpTokens.COMMA; if(callArgumentList instanceof CSharpDictionaryInitializerImpl) { delimiter = CSharpTokens.EQ; } parameterIndex = ParameterInfoUtils.getCurrentParameterIndex(callArgumentList.getNode(), context.getOffset(), delimiter); } context.setCurrentParameter(parameterIndex); if(context.getParameterOwner() == null) { context.setParameterOwner(place); } else if(context.getParameterOwner() != owner) { context.removeHint(); return; } final Object[] objects = context.getObjectsToView(); for(int i = 0; i < objects.length; i++) { context.setUIComponentEnabled(i, true); } }
@Override public void updateParameterInfo(@NotNull PsiElement place, UpdateParameterInfoContext context) { int parameterIndex = -1; DotNetTypeList typeList = PsiTreeUtil.getParentOfType(place, DotNetTypeList.class, false); if(typeList == null) { context.removeHint(); return; } if(!(typeList.getParent() instanceof CSharpReferenceExpression)) { context.removeHint(); return; } parameterIndex = ParameterInfoUtils.getCurrentParameterIndex(typeList.getNode(), context.getOffset(), CSharpTokens.COMMA); context.setCurrentParameter(parameterIndex); if(context.getParameterOwner() == null) { context.setParameterOwner(place); } else if(context.getParameterOwner() != PsiTreeUtil.getParentOfType(place, CSharpReferenceExpression.class, false)) { context.removeHint(); return; } final Object[] objects = context.getObjectsToView(); for(int i = 0; i < objects.length; i++) { context.setUIComponentEnabled(i, true); } }
@Nullable public static JSArgumentList findArgumentList(final PsiFile file, final int offset) { JSArgumentList argList = ParameterInfoUtils.findParentOfType(file, offset, JSArgumentList.class); if(argList == null) { final JSCallExpression callExpression = ParameterInfoUtils.findParentOfType(file, offset, JSCallExpression.class); if(callExpression != null) { argList = callExpression.getArgumentList(); } } return argList; }
@Override public void updateParameterInfo(@NotNull final JSArgumentList o, final UpdateParameterInfoContext context) { if(context.getParameterOwner() != o) { context.removeHint(); return; } final int currentParameterIndex = ParameterInfoUtils.getCurrentParameterIndex(o.getNode(), context.getOffset(), JSTokenTypes.COMMA); context.setCurrentParameter(currentParameterIndex); }
private PsiExpressionList findArgumentList(final PsiFile file, int offset, int parameterStart) { PsiExpressionList argumentList = ParameterInfoUtils.findArgumentList(file, offset, parameterStart, this); if(argumentList == null) { final PsiMethodCallExpression methodCall = ParameterInfoUtils.findParentOfTypeWithStopElements(file, offset, PsiMethodCallExpression.class, PsiMethod.class); if(methodCall != null) { argumentList = methodCall.getArgumentList(); } } return argumentList; }
@Override public void updateParameterInfo(@NotNull XQueryArgumentList place, UpdateParameterInfoContext context) { context.setCurrentParameter(ParameterInfoUtils.getCurrentParameterIndex(place.getNode(), context.getOffset(), XQueryTypes.COMMA)); }
@Nullable @Override public String getParameterCloseChars() { return ParameterInfoUtils.DEFAULT_PARAMETER_CLOSE_CHARS; }
@Override public String getParameterCloseChars() { return ParameterInfoUtils.DEFAULT_PARAMETER_CLOSE_CHARS; }