formatIfEnabled method

  1. @experimental
Future<FormatIfEnabledResult> formatIfEnabled(
  1. List<String>? directories
)

Format the contents of the files in one or more directories, but only if the analysis options file for those files has enabled the 'format' option.

If any of the specified directories does not exist, that directory will be ignored. If any of the files that are eligible for being formatted cannot be formatted because of a syntax error in the file, that file will be ignored.

Implementation

@experimental
Future<FormatIfEnabledResult> formatIfEnabled(List<String>? directories) {
  final Map m = {'directories': directories};
  return _call('edit.formatIfEnabled', m).then(FormatIfEnabledResult.parse);
}