| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library services.src.correction.fix; | 5 library services.src.correction.fix; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analysis_services/correction/change.dart'; | 9 import 'package:analysis_services/correction/change.dart'; |
| 10 import 'package:analysis_services/correction/fix.dart'; | 10 import 'package:analysis_services/correction/fix.dart'; |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 return fixes; | 198 return fixes; |
| 199 } | 199 } |
| 200 | 200 |
| 201 void _addFix(FixKind kind, List args, {String fixFile}) { | 201 void _addFix(FixKind kind, List args, {String fixFile}) { |
| 202 if (fixFile == null) { | 202 if (fixFile == null) { |
| 203 fixFile = file; | 203 fixFile = file; |
| 204 } | 204 } |
| 205 FileEdit fileEdit = new FileEdit(file); | 205 FileEdit fileEdit = new FileEdit(file); |
| 206 edits.forEach((edit) => fileEdit.add(edit)); | 206 edits.forEach((edit) => fileEdit.add(edit)); |
| 207 // prepare Change | 207 // prepare Change |
| 208 String message = JavaString.format(kind.message, args); | 208 String message = formatList(kind.message, args); |
| 209 Change change = new Change(message); | 209 Change change = new Change(message); |
| 210 change.addFileEdit(fileEdit); | 210 change.addFileEdit(fileEdit); |
| 211 linkedPositionGroups.values.forEach( | 211 linkedPositionGroups.values.forEach( |
| 212 (group) => change.addLinkedEditGroup(group)); | 212 (group) => change.addLinkedEditGroup(group)); |
| 213 change.selection = exitPosition; | 213 change.selection = exitPosition; |
| 214 // add Fix | 214 // add Fix |
| 215 Fix fix = new Fix(kind, change); | 215 Fix fix = new Fix(kind, change); |
| 216 fixes.add(fix); | 216 fixes.add(fix); |
| 217 // clear | 217 // clear |
| 218 edits.clear(); | 218 edits.clear(); |
| (...skipping 1684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1903 /** | 1903 /** |
| 1904 * Describes the location for a newly created [ConstructorDeclaration]. | 1904 * Describes the location for a newly created [ConstructorDeclaration]. |
| 1905 */ | 1905 */ |
| 1906 class _ConstructorLocation { | 1906 class _ConstructorLocation { |
| 1907 final String _prefix; | 1907 final String _prefix; |
| 1908 final int _offset; | 1908 final int _offset; |
| 1909 final String _suffix; | 1909 final String _suffix; |
| 1910 | 1910 |
| 1911 _ConstructorLocation(this._prefix, this._offset, this._suffix); | 1911 _ConstructorLocation(this._prefix, this._offset, this._suffix); |
| 1912 } | 1912 } |
| OLD | NEW |