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

Unified Diff: editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/SourceEdit.java

Issue 472373002: Support potential edits (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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/doc/api.html » ('j') | pkg/analysis_server/tool/spec/spec_input.html » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/SourceEdit.java
diff --git a/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/SourceEdit.java b/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/SourceEdit.java
index 87f19ec5cb8bff4af8d75d16836ce436104dcd67..a2a3699cd88c0b0520657a731e005b7b7c84ab44 100644
--- a/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/SourceEdit.java
+++ b/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/SourceEdit.java
@@ -51,12 +51,24 @@ public class SourceEdit {
private final String replacement;
/**
+ * An identifier that uniquely identifies this source edit from other edits in the same response.
+ * This field is omitted unless a containing structure needs to be able to identify the edit for
+ * some reason.
+ *
+ * For example, some refactoring operations can produce edits that might not be appropriate
+ * (referred to as potential edits). Such edits will have an id so that they can be referenced.
+ * Edits in the same response that do not need to be referenced will not have an id.
+ */
+ private final String id;
+
+ /**
* Constructor for {@link SourceEdit}.
*/
- public SourceEdit(int offset, int length, String replacement) {
+ public SourceEdit(int offset, int length, String replacement, String id) {
this.offset = offset;
this.length = length;
this.replacement = replacement;
+ this.id = id;
}
@Override
@@ -66,12 +78,26 @@ public class SourceEdit {
return
other.offset == offset &&
other.length == length &&
- ObjectUtilities.equals(other.replacement, replacement);
+ ObjectUtilities.equals(other.replacement, replacement) &&
+ ObjectUtilities.equals(other.id, id);
}
return false;
}
/**
+ * An identifier that uniquely identifies this source edit from other edits in the same response.
+ * This field is omitted unless a containing structure needs to be able to identify the edit for
+ * some reason.
+ *
+ * For example, some refactoring operations can produce edits that might not be appropriate
+ * (referred to as potential edits). Such edits will have an id so that they can be referenced.
+ * Edits in the same response that do not need to be referenced will not have an id.
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
* The length of the region to be modified.
*/
public int getLength() {
@@ -101,7 +127,9 @@ public class SourceEdit {
builder.append("length=");
builder.append(length + ", ");
builder.append("replacement=");
- builder.append(replacement);
+ builder.append(replacement + ", ");
+ builder.append("id=");
+ builder.append(id);
builder.append("]");
return builder.toString();
}
« no previous file with comments | « no previous file | pkg/analysis_server/doc/api.html » ('j') | pkg/analysis_server/tool/spec/spec_input.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698