Index: pkg/analysis_server/test/integration/integration_test_methods.dart |
diff --git a/pkg/analysis_server/test/integration/integration_test_methods.dart b/pkg/analysis_server/test/integration/integration_test_methods.dart |
index 4da1b0c6807d25e6294eb2adfbd95ed24c447adf..e9ed8df3c561d276710f79de64f66d8548a0958e 100644 |
--- a/pkg/analysis_server/test/integration/integration_test_methods.dart |
+++ b/pkg/analysis_server/test/integration/integration_test_methods.dart |
@@ -1390,6 +1390,39 @@ abstract class IntegrationTestMixin { |
} |
/** |
+ * Organizes all of the directives - removes unused imports and sorts |
+ * directives of the given Dart file. |
+ * |
+ * 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, ORGANIZE_DIRECTIVES_INVALID_FILE will |
+ * be generated. |
+ * |
+ * If the Dart file has scan or parse errors, |
+ * ORGANIZE_DIRECTIVES_PARSE_ERRORS will be generated. |
+ * |
+ * Parameters |
+ * |
+ * file ( FilePath ) |
+ * |
+ * The Dart file to organize directives in. |
+ * |
+ * Returns |
+ * |
+ * edit ( SourceFileEdit ) |
+ * |
+ * The file edit that is to be applied to the given file to effect the |
+ * organizing. |
+ */ |
+ Future<EditOrganizeDirectivesResult> sendEditOrganizeDirectives(String file) { |
+ var params = new EditOrganizeDirectivesParams(file).toJson(); |
+ return server.send("edit.organizeDirectives", params) |
+ .then((result) { |
+ ResponseDecoder decoder = new ResponseDecoder(null); |
+ return new EditOrganizeDirectivesResult.fromJson(decoder, 'result', result); |
+ }); |
+ } |
+ |
+ /** |
* Create an execution context for the executable file with the given path. |
* The context that is created will persist until execution.deleteContext is |
* used to delete it. Clients, therefore, are responsible for managing the |