docs: @SuppressWarnings({ "checkstyle:npathcomplexity" })
  	private <T extends EObject> void createImplicitVarValType(XtextResource resource, IAcceptor<? super ICodeMining> acceptor,
  			Class<T> elementType,
  			Function1<T, JvmTypeReference> getDeclaredTypeLambda,
  			Function1<T, String> getInferredTypeLambda,
  			Function1<T, XExpression> getExprLambda,
  			Function0<Assignment> getAssignmentLambda) {
  		final List<T> elements = EcoreUtil2.eAllOfType(resource.getContents().get(0), elementType);
  
  		for (final T element : elements) {
  			// inline annotation only for fields with no type
  			final JvmTypeReference declaredType = getDeclaredTypeLambda.apply(element);
  			final XExpression expr = getExprLambda != null ? getExprLambda.apply(element) : null;
  			if (declaredType != null || (getExprLambda != null && expr == null)) {
  				continue;
  			}
  			// get inferred type name from JVM element
  			final String inferredType = getInferredTypeLambda.apply(element);
  			if (Strings.isEmpty(inferredType)) {
  				continue;
  			}
  			// find document offset for inline annotation
  			final ICompositeNode node = NodeModelUtils.findActualNodeFor(element);
  			final Assignment elementAssignment = getAssignmentLambda.apply();
  			assert elementAssignment != null;
  			for (Iterator<INode> it = node.getAsTreeIterable().iterator(); it.hasNext();) {
  				final INode child = it.next();
  				if (child != node) {
  					final EObject grammarElement = child.getGrammarElement();
  					if (grammarElement instanceof RuleCall) {
  						if (elementAssignment.equals(grammarElement.eContainer())) {
  							final String text = this.keywords.getColonKeyword() + " " + inferredType + " "; //$NON-NLS-1$ //$NON-NLS-2$
  							final int offset = child.getPreviousSibling().getTotalOffset();
  							acceptor.accept(createNewLineContentCodeMining(offset, text));
  							break;
  						}
  					}
  				}
  			}
  		}
  	}