Index: pkg/analysis_server/lib/src/services/correction/sort_members.dart |
diff --git a/pkg/analysis_server/lib/src/services/correction/sort_members.dart b/pkg/analysis_server/lib/src/services/correction/sort_members.dart |
index d5bb1265409d9b23d838802a1e28e82aabe5c562..459236717d81475b026bbbbbb3d938fc80cd1b4a 100644 |
--- a/pkg/analysis_server/lib/src/services/correction/sort_members.dart |
+++ b/pkg/analysis_server/lib/src/services/correction/sort_members.dart |
@@ -62,16 +62,9 @@ class MemberSorter { |
// prepare edits |
List<SourceEdit> edits = <SourceEdit>[]; |
if (code != initialCode) { |
- int prefixLength = findCommonPrefix(initialCode, code); |
- int suffixLength = findCommonSuffix(initialCode, code); |
- String prefix = code.substring(0, prefixLength); |
- String suffix = code.substring(code.length - suffixLength, code.length); |
- int commonLength = findCommonOverlap(prefix, suffix); |
- suffixLength -= commonLength; |
- SourceEdit edit = new SourceEdit( |
- prefixLength, |
- initialCode.length - suffixLength - prefixLength, |
- code.substring(prefixLength, code.length - suffixLength)); |
+ SimpleDiff diff = computeSimpleDiff(initialCode, code); |
+ SourceEdit edit = |
+ new SourceEdit(diff.offset, diff.length, diff.replacement); |
edits.add(edit); |
} |
return edits; |