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

Unified Diff: pkg/analysis_server/lib/src/provisional/edit/utilities/change_builder_core.dart

Issue 2776233002: Enhance the change builders (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/provisional/edit/utilities/change_builder_dart.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/provisional/edit/utilities/change_builder_core.dart
diff --git a/pkg/analysis_server/lib/src/provisional/edit/utilities/change_builder_core.dart b/pkg/analysis_server/lib/src/provisional/edit/utilities/change_builder_core.dart
index 8fbcbdf48989e1921b96f3ba6565d65c06e69e68..28f42c81addee1f435ce16cdff63bf051cf3ba25 100644
--- a/pkg/analysis_server/lib/src/provisional/edit/utilities/change_builder_core.dart
+++ b/pkg/analysis_server/lib/src/provisional/edit/utilities/change_builder_core.dart
@@ -93,6 +93,28 @@ abstract class FileEditBuilder {
*/
void addReplacement(
int offset, int length, void buildEdit(EditBuilder builder));
+
+ /**
+ * Add an insertion of the given [text] at the given [offset]. The [offset] is
+ * relative to the original source. This is fully equivalent to
+ *
+ * addInsertion(offset, (EditBuilder builder) {
+ * builder.write(text);
+ * });
+ */
+ void addSimpleInsertion(int offset, String text);
+
+ /**
+ * Add a replacement of the text starting at the given [offset] and continuing
+ * for the given [length]. The [offset] is relative to the original source.
+ * The original content will be replaced by the given [text]. This is fully
+ * equivalent to
+ *
+ * addReplacement(offset, length, (EditBuilder builder) {
+ * builder.write(text);
+ * });
+ */
+ void addSimpleReplacement(int offset, int length, String text);
}
/**
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/provisional/edit/utilities/change_builder_dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698