organizeDirectives method
Organizes all of the directives - removes unused imports and sorts
directives of the given Dart file according to the (Dart Style
Guide)https://dart.dev/guides/language/effective-dart/style
.
If a request is made for a file that does not exist, does not belong to an
analysis root or is not a Dart file, FILE_NOT_ANALYZED
will be
generated.
If directives of the Dart file cannot be organized, for example because it
has scan or parse errors, or by other reasons, ORGANIZE_DIRECTIVES_ERROR
will be generated. The message will provide details about the reason.
Implementation
Future<OrganizeDirectivesResult> organizeDirectives(String? file) {
final Map m = {'file': file};
return _call('edit.organizeDirectives', m)
.then(OrganizeDirectivesResult.parse);
}