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

Side by Side Diff: pkg/analyzer/lib/src/summary/format.dart

Issue 2042883002: Add put/getSourceErrorsInLibrary to IncrementalCache. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fixes for review comments. Created 4 years, 6 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
« no previous file with comments | « pkg/analyzer/lib/src/generated/error.dart ('k') | pkg/analyzer/lib/src/summary/format.fbs » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 file has been automatically generated. Please do not edit it manually. 5 // This file has been automatically generated. Please do not edit it manually.
6 // To regenerate the file, use the script "pkg/analyzer/tool/generate_files". 6 // To regenerate the file, use the script "pkg/analyzer/tool/generate_files".
7 7
8 library analyzer.src.summary.format; 8 library analyzer.src.summary.format;
9 9
10 import 'flat_buffers.dart' as fb; 10 import 'flat_buffers.dart' as fb;
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 @override 134 @override
135 int get size => 1; 135 int get size => 1;
136 136
137 @override 137 @override
138 idl.UnlinkedParamKind read(fb.BufferContext bc, int offset) { 138 idl.UnlinkedParamKind read(fb.BufferContext bc, int offset) {
139 int index = const fb.Uint8Reader().read(bc, offset); 139 int index = const fb.Uint8Reader().read(bc, offset);
140 return index < idl.UnlinkedParamKind.values.length ? idl.UnlinkedParamKind.v alues[index] : idl.UnlinkedParamKind.required; 140 return index < idl.UnlinkedParamKind.values.length ? idl.UnlinkedParamKind.v alues[index] : idl.UnlinkedParamKind.required;
141 } 141 }
142 } 142 }
143 143
144 class CacheAnalysisErrorBuilder extends Object with _CacheAnalysisErrorMixin imp lements idl.CacheAnalysisError {
145 bool _finished = false;
146
147 String _correction;
148 String _errorCodeUniqueName;
149 int _length;
150 String _message;
151 int _offset;
152
153 @override
154 String get correction => _correction ??= '';
155
156 /**
157 * The correction to be displayed for this error, or `null` if there is no
158 * correction information for this error. The correction should indicate how
159 * the user can fix the error.
160 */
161 void set correction(String _value) {
162 assert(!_finished);
163 _correction = _value;
164 }
165
166 @override
167 String get errorCodeUniqueName => _errorCodeUniqueName ??= '';
168
169 /**
170 * The unique name of the error code.
171 */
172 void set errorCodeUniqueName(String _value) {
173 assert(!_finished);
174 _errorCodeUniqueName = _value;
175 }
176
177 @override
178 int get length => _length ??= 0;
179
180 /**
181 * Length of the error range.
182 */
183 void set length(int _value) {
184 assert(!_finished);
185 assert(_value == null || _value >= 0);
186 _length = _value;
187 }
188
189 @override
190 String get message => _message ??= '';
191
192 /**
193 * The message to be displayed for this error. The message should indicate
194 * what is wrong and why it is wrong.
195 */
196 void set message(String _value) {
197 assert(!_finished);
198 _message = _value;
199 }
200
201 @override
202 int get offset => _offset ??= 0;
203
204 /**
205 * Offset of the error range relative to the beginning of the file.
206 */
207 void set offset(int _value) {
208 assert(!_finished);
209 assert(_value == null || _value >= 0);
210 _offset = _value;
211 }
212
213 CacheAnalysisErrorBuilder({String correction, String errorCodeUniqueName, int length, String message, int offset})
214 : _correction = correction,
215 _errorCodeUniqueName = errorCodeUniqueName,
216 _length = length,
217 _message = message,
218 _offset = offset;
219
220 /**
221 * Flush [informative] data recursively.
222 */
223 void flushInformative() {
224 }
225
226 fb.Offset finish(fb.Builder fbBuilder) {
227 assert(!_finished);
228 _finished = true;
229 fb.Offset offset_correction;
230 fb.Offset offset_errorCodeUniqueName;
231 fb.Offset offset_message;
232 if (_correction != null) {
233 offset_correction = fbBuilder.writeString(_correction);
234 }
235 if (_errorCodeUniqueName != null) {
236 offset_errorCodeUniqueName = fbBuilder.writeString(_errorCodeUniqueName);
237 }
238 if (_message != null) {
239 offset_message = fbBuilder.writeString(_message);
240 }
241 fbBuilder.startTable();
242 if (offset_correction != null) {
243 fbBuilder.addOffset(4, offset_correction);
244 }
245 if (offset_errorCodeUniqueName != null) {
246 fbBuilder.addOffset(0, offset_errorCodeUniqueName);
247 }
248 if (_length != null && _length != 0) {
249 fbBuilder.addUint32(2, _length);
250 }
251 if (offset_message != null) {
252 fbBuilder.addOffset(3, offset_message);
253 }
254 if (_offset != null && _offset != 0) {
255 fbBuilder.addUint32(1, _offset);
256 }
257 return fbBuilder.endTable();
258 }
259 }
260
261 class _CacheAnalysisErrorReader extends fb.TableReader<_CacheAnalysisErrorImpl> {
262 const _CacheAnalysisErrorReader();
263
264 @override
265 _CacheAnalysisErrorImpl createObject(fb.BufferContext bc, int offset) => new _ CacheAnalysisErrorImpl(bc, offset);
266 }
267
268 class _CacheAnalysisErrorImpl extends Object with _CacheAnalysisErrorMixin imple ments idl.CacheAnalysisError {
269 final fb.BufferContext _bc;
270 final int _bcOffset;
271
272 _CacheAnalysisErrorImpl(this._bc, this._bcOffset);
273
274 String _correction;
275 String _errorCodeUniqueName;
276 int _length;
277 String _message;
278 int _offset;
279
280 @override
281 String get correction {
282 _correction ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 4, '');
283 return _correction;
284 }
285
286 @override
287 String get errorCodeUniqueName {
288 _errorCodeUniqueName ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 0 , '');
289 return _errorCodeUniqueName;
290 }
291
292 @override
293 int get length {
294 _length ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 2, 0);
295 return _length;
296 }
297
298 @override
299 String get message {
300 _message ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 3, '');
301 return _message;
302 }
303
304 @override
305 int get offset {
306 _offset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 1, 0);
307 return _offset;
308 }
309 }
310
311 abstract class _CacheAnalysisErrorMixin implements idl.CacheAnalysisError {
312 @override
313 Map<String, Object> toJson() {
314 Map<String, Object> _result = <String, Object>{};
315 if (correction != '') _result["correction"] = correction;
316 if (errorCodeUniqueName != '') _result["errorCodeUniqueName"] = errorCodeUni queName;
317 if (length != 0) _result["length"] = length;
318 if (message != '') _result["message"] = message;
319 if (offset != 0) _result["offset"] = offset;
320 return _result;
321 }
322
323 @override
324 Map<String, Object> toMap() => {
325 "correction": correction,
326 "errorCodeUniqueName": errorCodeUniqueName,
327 "length": length,
328 "message": message,
329 "offset": offset,
330 };
331
332 @override
333 String toString() => convert.JSON.encode(toJson());
334 }
335
144 class CacheSourceContentBuilder extends Object with _CacheSourceContentMixin imp lements idl.CacheSourceContent { 336 class CacheSourceContentBuilder extends Object with _CacheSourceContentMixin imp lements idl.CacheSourceContent {
145 bool _finished = false; 337 bool _finished = false;
146 338
147 List<String> _exportedUris; 339 List<String> _exportedUris;
148 List<String> _importedUris; 340 List<String> _importedUris;
149 idl.CacheSourceKind _kind; 341 idl.CacheSourceKind _kind;
150 List<String> _partUris; 342 List<String> _partUris;
151 343
152 @override 344 @override
153 List<String> get exportedUris => _exportedUris ??= <String>[]; 345 List<String> get exportedUris => _exportedUris ??= <String>[];
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 "exportedUris": exportedUris, 501 "exportedUris": exportedUris,
310 "importedUris": importedUris, 502 "importedUris": importedUris,
311 "kind": kind, 503 "kind": kind,
312 "partUris": partUris, 504 "partUris": partUris,
313 }; 505 };
314 506
315 @override 507 @override
316 String toString() => convert.JSON.encode(toJson()); 508 String toString() => convert.JSON.encode(toJson());
317 } 509 }
318 510
511 class CacheSourceErrorsInLibraryBuilder extends Object with _CacheSourceErrorsIn LibraryMixin implements idl.CacheSourceErrorsInLibrary {
512 bool _finished = false;
513
514 List<CacheAnalysisErrorBuilder> _errors;
515
516 @override
517 List<CacheAnalysisErrorBuilder> get errors => _errors ??= <CacheAnalysisErrorB uilder>[];
518
519 /**
520 * The list of errors in the source in the library.
521 */
522 void set errors(List<CacheAnalysisErrorBuilder> _value) {
523 assert(!_finished);
524 _errors = _value;
525 }
526
527 CacheSourceErrorsInLibraryBuilder({List<CacheAnalysisErrorBuilder> errors})
528 : _errors = errors;
529
530 /**
531 * Flush [informative] data recursively.
532 */
533 void flushInformative() {
534 _errors?.forEach((b) => b.flushInformative());
535 }
536
537 List<int> toBuffer() {
538 fb.Builder fbBuilder = new fb.Builder();
539 return fbBuilder.finish(finish(fbBuilder), "CSEL");
540 }
541
542 fb.Offset finish(fb.Builder fbBuilder) {
543 assert(!_finished);
544 _finished = true;
545 fb.Offset offset_errors;
546 if (!(_errors == null || _errors.isEmpty)) {
547 offset_errors = fbBuilder.writeList(_errors.map((b) => b.finish(fbBuilder) ).toList());
548 }
549 fbBuilder.startTable();
550 if (offset_errors != null) {
551 fbBuilder.addOffset(0, offset_errors);
552 }
553 return fbBuilder.endTable();
554 }
555 }
556
557 idl.CacheSourceErrorsInLibrary readCacheSourceErrorsInLibrary(List<int> buffer) {
558 fb.BufferContext rootRef = new fb.BufferContext.fromBytes(buffer);
559 return const _CacheSourceErrorsInLibraryReader().read(rootRef, 0);
560 }
561
562 class _CacheSourceErrorsInLibraryReader extends fb.TableReader<_CacheSourceError sInLibraryImpl> {
563 const _CacheSourceErrorsInLibraryReader();
564
565 @override
566 _CacheSourceErrorsInLibraryImpl createObject(fb.BufferContext bc, int offset) => new _CacheSourceErrorsInLibraryImpl(bc, offset);
567 }
568
569 class _CacheSourceErrorsInLibraryImpl extends Object with _CacheSourceErrorsInLi braryMixin implements idl.CacheSourceErrorsInLibrary {
570 final fb.BufferContext _bc;
571 final int _bcOffset;
572
573 _CacheSourceErrorsInLibraryImpl(this._bc, this._bcOffset);
574
575 List<idl.CacheAnalysisError> _errors;
576
577 @override
578 List<idl.CacheAnalysisError> get errors {
579 _errors ??= const fb.ListReader<idl.CacheAnalysisError>(const _CacheAnalysis ErrorReader()).vTableGet(_bc, _bcOffset, 0, const <idl.CacheAnalysisError>[]);
580 return _errors;
581 }
582 }
583
584 abstract class _CacheSourceErrorsInLibraryMixin implements idl.CacheSourceErrors InLibrary {
585 @override
586 Map<String, Object> toJson() {
587 Map<String, Object> _result = <String, Object>{};
588 if (errors.isNotEmpty) _result["errors"] = errors.map((_value) => _value.toJ son()).toList();
589 return _result;
590 }
591
592 @override
593 Map<String, Object> toMap() => {
594 "errors": errors,
595 };
596
597 @override
598 String toString() => convert.JSON.encode(toJson());
599 }
600
319 class CodeRangeBuilder extends Object with _CodeRangeMixin implements idl.CodeRa nge { 601 class CodeRangeBuilder extends Object with _CodeRangeMixin implements idl.CodeRa nge {
320 bool _finished = false; 602 bool _finished = false;
321 603
322 int _length; 604 int _length;
323 int _offset; 605 int _offset;
324 606
325 @override 607 @override
326 int get length => _length ??= 0; 608 int get length => _length ??= 0;
327 609
328 /** 610 /**
(...skipping 8110 matching lines...) Expand 10 before | Expand all | Expand 10 after
8439 "propagatedTypeSlot": propagatedTypeSlot, 8721 "propagatedTypeSlot": propagatedTypeSlot,
8440 "type": type, 8722 "type": type,
8441 "visibleLength": visibleLength, 8723 "visibleLength": visibleLength,
8442 "visibleOffset": visibleOffset, 8724 "visibleOffset": visibleOffset,
8443 }; 8725 };
8444 8726
8445 @override 8727 @override
8446 String toString() => convert.JSON.encode(toJson()); 8728 String toString() => convert.JSON.encode(toJson());
8447 } 8729 }
8448 8730
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/error.dart ('k') | pkg/analyzer/lib/src/summary/format.fbs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698