void (PsiElement originalElement, GrVariable variable, @Nls StringBuilder buffer, boolean isRendered) { PsiType inferredType = null; if (PsiImplUtil.isWhiteSpaceOrNls(originalElement)) { originalElement = PsiTreeUtil.prevLeaf(originalElement); } if (originalElement != null && originalElement.getNode().getElementType() == GroovyTokenTypes.mIDENT) { originalElement = originalElement.getParent(); } if (originalElement instanceof GrReferenceExpression) { inferredType = ((GrReferenceExpression)originalElement).getType(); } else if (originalElement instanceof GrVariableDeclaration) { inferredType = variable.getTypeGroovy(); } else if (originalElement instanceof GrVariable) { inferredType = ((GrVariable)originalElement).getTypeGroovy(); } String typeLabel = inferredType != null ? GroovyBundle.message("documentation.inferred.type.label") : GroovyBundle.message("documentation.cannot.infer.type.label"); appendStyledSpan(buffer, "[" + typeLabel + "]", "color: #909090"); if (inferredType != null) { buffer.append(" "); appendTypeString(buffer, inferredType, originalElement, isRendered); } }