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

Side by Side Diff: pkg/analysis_services/lib/src/correction/source_buffer.dart

Issue 418373002: More tests for creating undefined methods and functions. (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « pkg/analysis_services/lib/src/correction/fix.dart ('k') | pkg/analysis_services/test/correction/change_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698