Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1490)

Unified Diff: pkg/analysis_server/test/integration/integration_test_methods.dart

Issue 1258563008: Proposal for the 'edit.organizeDirectives' request. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698