addDocumentationComments function

void addDocumentationComments(
  1. Indent indent,
  2. List<String> comments,
  3. DocumentCommentSpecification commentSpec, {
  4. List<String> generatorComments = const <String>[],
})

Formats documentation comments and adds them to current Indent.

The comments list is meant for comments written in the input Dart file. The generatorComments list is meant for comments added by the generators. Include white space for all tokens when called, no assumptions are made.

Implementation

void addDocumentationComments(
  Indent indent,
  List<String> comments,
  DocumentCommentSpecification commentSpec, {
  List<String> generatorComments = const <String>[],
}) {
  asDocumentationComments(
    comments,
    commentSpec,
    generatorComments: generatorComments,
  ).forEach(indent.writeln);
}