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

Unified Diff: pkg/analysis_server/lib/src/services/correction/change.dart

Issue 492243002: Introduce convenience methods into generated analysis server classes. (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
Index: pkg/analysis_server/lib/src/services/correction/change.dart
diff --git a/pkg/analysis_server/lib/src/services/correction/change.dart b/pkg/analysis_server/lib/src/services/correction/change.dart
index c3edd702d5a99fc3fffa5871f60104d925b9e649..456573d6eeef7ea968da0b3f3cc5247111a7f3b9 100644
--- a/pkg/analysis_server/lib/src/services/correction/change.dart
+++ b/pkg/analysis_server/lib/src/services/correction/change.dart
@@ -7,7 +7,6 @@ library services.correction.change;
import 'package:analysis_server/src/constants.dart';
import 'package:analysis_server/src/protocol2.dart';
import 'package:analysis_server/src/services/json.dart';
-import 'package:analyzer/src/generated/source.dart';
/**
@@ -95,32 +94,6 @@ class Change implements HasToJson {
/**
- * Convert a SourceRange to a SourceEdit.
- */
-SourceEdit editFromRange(SourceRange range, String replacement, {String id}) =>
- new SourceEdit(range.offset, range.length, replacement, id: id);
-
-/**
- * Get the result of applying the edit to the given [code].
- */
-String applyEdit(String code, SourceEdit edit) {
- return code.substring(0, edit.offset) + edit.replacement +
- code.substring(edit.offset + edit.length);
-}
-
-/**
- * Get the result of applying a set of [edits] to the given [code]. Edits
- * are applied in the order they appear in [edits].
- */
-String applySequence(String code, Iterable<SourceEdit> edits) {
- edits.forEach((SourceEdit edit) {
- code = applyEdit(code, edit);
- });
- return code;
-}
-
-
-/**
* A description of a set of changes to a single file.
*
* [Edit]s are added in the order of decreasing offset, so they are easy to
« no previous file with comments | « pkg/analysis_server/lib/src/protocol2.dart ('k') | pkg/analysis_server/lib/src/services/refactoring/extract_local.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698