| 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 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library services.src.correction.source_buffer; | 8 library services.src.correction.source_buffer; |
| 9 | 9 |
| 10 import 'package:analysis_services/correction/change.dart'; | 10 import 'package:analysis_services/correction/change.dart'; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 LinkedPositionGroup _currentLinkedPositionGroup; | 24 LinkedPositionGroup _currentLinkedPositionGroup; |
| 25 int _currentPositionStart; | 25 int _currentPositionStart; |
| 26 | 26 |
| 27 SourceBuilder(this.file, this.offset); | 27 SourceBuilder(this.file, this.offset); |
| 28 | 28 |
| 29 SourceBuilder.buffer() : file = null, offset = 0; | 29 SourceBuilder.buffer() : file = null, offset = 0; |
| 30 | 30 |
| 31 int get length => _buffer.length; | 31 int get length => _buffer.length; |
| 32 | 32 |
| 33 void addProposal(String proposal) { | 33 void addProposal(String proposal) { |
| 34 // TODO(scheglov) implement | 34 _currentLinkedPositionGroup.addProposal(proposal); |
| 35 // _currentPositionGroup.addProposal(); | |
| 36 } | 35 } |
| 37 | 36 |
| 38 void addProposals(List<String> proposals) { | 37 void addProposals(List<String> proposals) { |
| 39 proposals.forEach((proposal) => addProposal(proposal)); | 38 proposals.forEach((proposal) => addProposal(proposal)); |
| 40 } | 39 } |
| 41 | 40 |
| 42 /** | 41 /** |
| 43 * Appends [s] to the buffer. | 42 * Appends [s] to the buffer. |
| 44 */ | 43 */ |
| 45 SourceBuilder append(String s) { | 44 SourceBuilder append(String s) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 @override | 76 @override |
| 78 String toString() => _buffer.toString(); | 77 String toString() => _buffer.toString(); |
| 79 | 78 |
| 80 /** | 79 /** |
| 81 * Adds position location [SourceRange] using current fields. | 80 * Adds position location [SourceRange] using current fields. |
| 82 */ | 81 */ |
| 83 void _addPosition() { | 82 void _addPosition() { |
| 84 int start = offset + _currentPositionStart; | 83 int start = offset + _currentPositionStart; |
| 85 int end = offset + _buffer.length; | 84 int end = offset + _buffer.length; |
| 86 Position position = new Position(file, start, end - start); | 85 Position position = new Position(file, start, end - start); |
| 87 _currentLinkedPositionGroup.add(position); | 86 _currentLinkedPositionGroup.addPosition(position); |
| 88 } | 87 } |
| 89 } | 88 } |
| OLD | NEW |