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

Side by Side Diff: pkg/analysis_server/lib/src/services/correction/change.dart

Issue 482573004: Change analysis server protocol to omit empty lists when optional. (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 library services.correction.change; 5 library services.correction.change;
6 6
7 import 'package:analysis_server/src/constants.dart'; 7 import 'package:analysis_server/src/constants.dart';
8 import 'package:analysis_server/src/protocol2.dart'; 8 import 'package:analysis_server/src/protocol2.dart';
9 import 'package:analysis_server/src/services/json.dart'; 9 import 'package:analysis_server/src/services/json.dart';
10 10
(...skipping 23 matching lines...) Expand all
34 Position selection; 34 Position selection;
35 35
36 Change(this.message); 36 Change(this.message);
37 37
38 /** 38 /**
39 * Adds [edit] to the [FileEdit] for the given [file]. 39 * Adds [edit] to the [FileEdit] for the given [file].
40 */ 40 */
41 void addEdit(String file, SourceEdit edit) { 41 void addEdit(String file, SourceEdit edit) {
42 SourceFileEdit fileEdit = getFileEdit(file); 42 SourceFileEdit fileEdit = getFileEdit(file);
43 if (fileEdit == null) { 43 if (fileEdit == null) {
44 fileEdit = new SourceFileEdit(file, <SourceEdit>[]); 44 fileEdit = new SourceFileEdit(file);
45 addFileEdit(fileEdit); 45 addFileEdit(fileEdit);
46 } 46 }
47 fileEdit.add(edit); 47 fileEdit.add(edit);
48 } 48 }
49 49
50 /** 50 /**
51 * Adds the given [FileEdit]. 51 * Adds the given [FileEdit].
52 */ 52 */
53 void addFileEdit(SourceFileEdit edit) { 53 void addFileEdit(SourceFileEdit edit) {
54 fileEdits.add(edit); 54 fileEdits.add(edit);
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 static const PARAMETER = const LinkedEditSuggestionKind('PARAMETER'); 165 static const PARAMETER = const LinkedEditSuggestionKind('PARAMETER');
166 static const TYPE = const LinkedEditSuggestionKind('TYPE'); 166 static const TYPE = const LinkedEditSuggestionKind('TYPE');
167 static const VARIABLE = const LinkedEditSuggestionKind('VARIABLE'); 167 static const VARIABLE = const LinkedEditSuggestionKind('VARIABLE');
168 final String name; 168 final String name;
169 169
170 const LinkedEditSuggestionKind(this.name); 170 const LinkedEditSuggestionKind(this.name);
171 171
172 @override 172 @override
173 String toString() => name; 173 String toString() => name;
174 } 174 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698