| 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.assist; | 5 library services.src.correction.assist; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analysis_services/correction/assist.dart'; | 9 import 'package:analysis_services/correction/assist.dart'; |
| 10 import 'package:analysis_services/correction/change.dart'; | 10 import 'package:analysis_services/correction/change.dart'; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 return null; | 121 return null; |
| 122 } | 122 } |
| 123 | 123 |
| 124 void _addAssist(AssistKind kind, List args, {String assistFile}) { | 124 void _addAssist(AssistKind kind, List args, {String assistFile}) { |
| 125 if (assistFile == null) { | 125 if (assistFile == null) { |
| 126 assistFile = file; | 126 assistFile = file; |
| 127 } | 127 } |
| 128 FileEdit fileEdit = new FileEdit(file); | 128 FileEdit fileEdit = new FileEdit(file); |
| 129 edits.forEach((edit) => fileEdit.add(edit)); | 129 edits.forEach((edit) => fileEdit.add(edit)); |
| 130 // prepare Change | 130 // prepare Change |
| 131 String message = JavaString.format(kind.message, args); | 131 String message = formatList(kind.message, args); |
| 132 Change change = new Change(message); | 132 Change change = new Change(message); |
| 133 change.addFileEdit(fileEdit); | 133 change.addFileEdit(fileEdit); |
| 134 linkedPositionGroups.values.forEach( | 134 linkedPositionGroups.values.forEach( |
| 135 (group) => change.addLinkedEditGroup(group)); | 135 (group) => change.addLinkedEditGroup(group)); |
| 136 change.selection = exitPosition; | 136 change.selection = exitPosition; |
| 137 // add Assist | 137 // add Assist |
| 138 Assist assist = new Assist(kind, change); | 138 Assist assist = new Assist(kind, change); |
| 139 assists.add(assist); | 139 assists.add(assist); |
| 140 // clear | 140 // clear |
| 141 edits.clear(); | 141 edits.clear(); |
| (...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1580 class _SimpleIdentifierRecursiveAstVisitor extends RecursiveAstVisitor { | 1580 class _SimpleIdentifierRecursiveAstVisitor extends RecursiveAstVisitor { |
| 1581 final _SimpleIdentifierVisitor visitor; | 1581 final _SimpleIdentifierVisitor visitor; |
| 1582 | 1582 |
| 1583 _SimpleIdentifierRecursiveAstVisitor(this.visitor); | 1583 _SimpleIdentifierRecursiveAstVisitor(this.visitor); |
| 1584 | 1584 |
| 1585 @override | 1585 @override |
| 1586 visitSimpleIdentifier(SimpleIdentifier node) { | 1586 visitSimpleIdentifier(SimpleIdentifier node) { |
| 1587 visitor(node); | 1587 visitor(node); |
| 1588 } | 1588 } |
| 1589 } | 1589 } |
| OLD | NEW |