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

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

Issue 2917943002: Postfix completion (Closed)
Patch Set: typo Created 3 years, 6 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/support/integration_test_methods.dart
diff --git a/pkg/analysis_server/test/integration/support/integration_test_methods.dart b/pkg/analysis_server/test/integration/support/integration_test_methods.dart
index c2e6cf41dfef4c7970ecc3ca59c908cd7835dc5c..52ddc01178c07109feb414b97704ce6c6a7409c4 100644
--- a/pkg/analysis_server/test/integration/support/integration_test_methods.dart
+++ b/pkg/analysis_server/test/integration/support/integration_test_methods.dart
@@ -1352,6 +1352,40 @@ abstract class IntegrationTestMixin {
}
/**
+ * Get the changes required to convert the postfix template at the given
+ * location into the template's expanded form.
+ *
+ * Parameters
+ *
+ * file: FilePath
+ *
+ * The file containing the postfix template to be expanded.
+ *
+ * key: String
+ *
+ * The unique name that identifies the template in use.
+ *
+ * offset: int
+ *
+ * The offset used to identify the code to which the template will be
+ * applied.
+ *
+ * Returns
+ *
+ * change: SourceChange
+ *
+ * The change to be applied in order to complete the statement.
+ */
+ Future<EditGetPostfixCompletionResult> sendEditGetPostfixCompletion(
+ String file, String key, int offset) async {
+ var params = new EditGetPostfixCompletionParams(file, key, offset).toJson();
+ var result = await server.send("edit.getPostfixCompletion", params);
+ ResponseDecoder decoder = new ResponseDecoder(null);
+ return new EditGetPostfixCompletionResult.fromJson(
+ decoder, 'result', result);
+ }
+
+ /**
* Get the changes required to perform a refactoring.
*
* If another refactoring request is received during the processing of this
@@ -1484,6 +1518,60 @@ abstract class IntegrationTestMixin {
}
/**
+ * Determine if the request postfix completion template is applicable at the
+ * given location in the given file.
+ *
+ * Parameters
+ *
+ * file: FilePath
+ *
+ * The file containing the postfix template to be expanded.
+ *
+ * key: String
+ *
+ * The unique name that identifies the template in use.
+ *
+ * offset: int
+ *
+ * The offset used to identify the code to which the template will be
+ * applied.
+ *
+ * Returns
+ *
+ * value: bool
+ *
+ * True if the template can be expanded at the given location.
+ */
+ Future<EditIsPostfixCompletionApplicableResult>
+ sendEditIsPostfixCompletionApplicable(
+ String file, String key, int offset) async {
+ var params =
+ new EditIsPostfixCompletionApplicableParams(file, key, offset).toJson();
+ var result =
+ await server.send("edit.isPostfixCompletionApplicable", params);
+ ResponseDecoder decoder = new ResponseDecoder(null);
+ return new EditIsPostfixCompletionApplicableResult.fromJson(
+ decoder, 'result', result);
+ }
+
+ /**
+ * Return a list of all postfix templates currently available.
+ *
+ * Returns
+ *
+ * templates: List<PostfixTemplateDescriptor>
+ *
+ * The list of available template.
+ */
+ Future<EditListPostfixCompletionTemplatesResult>
+ sendEditListPostfixCompletionTemplates() async {
+ var result = await server.send("edit.listPostfixCompletionTemplates", null);
+ ResponseDecoder decoder = new ResponseDecoder(null);
+ return new EditListPostfixCompletionTemplatesResult.fromJson(
+ decoder, 'result', result);
+ }
+
+ /**
* Sort all of the directives, unit and class members of the given Dart file.
*
* If a request is made for a file that does not exist, does not belong to an

Powered by Google App Engine
This is Rietveld 408576698