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

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

Issue 2809943002: More enhancements to ChangeBuilder (Closed)
Patch Set: Created 3 years, 8 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/utilities/change_builder_core.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 28f42c81addee1f435ce16cdff63bf051cf3ba25..7ecf9869ee8fe1b12e939ad3b971275ecbbe2ef1 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
@@ -6,6 +6,7 @@ import 'dart:async';
import 'package:analysis_server/plugin/protocol/protocol.dart';
import 'package:analysis_server/src/utilities/change_builder_core.dart';
+import 'package:meta/meta.dart';
/**
* A builder used to build a [SourceChange].
@@ -33,6 +34,11 @@ abstract class ChangeBuilder {
*/
Future<Null> addFileEdit(
String path, int timeStamp, void buildFileEdit(FileEditBuilder builder));
+
+ /**
+ * Set the selection for the change being built to the given [position].
+ */
+ void setSelection(Position position);
}
/**
@@ -51,6 +57,12 @@ abstract class EditBuilder {
String groupName, void buildLinkedEdit(LinkedEditBuilder builder));
/**
+ * Set the selection to the given location within the edit being built.
+ */
+ @experimental
+ void selectHere();
+
+ /**
* Add the given [string] to the content of the current edit.
*/
void write(String string);
@@ -69,6 +81,12 @@ abstract class EditBuilder {
*/
abstract class FileEditBuilder {
/**
+ * Add a deletion of text starting at the given [offset] and continuing for
+ * the given [length].
+ */
+ void addDeletion(int offset, int length);
+
+ /**
* Add an insertion of text at the given [offset]. The [offset] is relative to
* the original source. The [buildEdit] function is used to write the text to
* be inserted. This is fully equivalent to
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/utilities/change_builder_core.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698