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

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: tweaks 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
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 _errorCodeClass;
149 String _errorCodeField;
150 int _length;
151 String _message;
152 int _offset;
153
154 @override
155 String get correction => _correction ??= '';
156
157 /**
158 * The correction to be displayed for this error, or `null` if there is no
159 * correction information for this error. The correction should indicate how
160 * the user can fix the error.
161 */
162 void set correction(String _value) {
163 assert(!_finished);
164 _correction = _value;
165 }
166
167 @override
168 String get errorCodeClass => _errorCodeClass ??= '';
169
170 /**
171 * The name of the `ErrorCode` subclass.
172 */
173 void set errorCodeClass(String _value) {
174 assert(!_finished);
175 _errorCodeClass = _value;
176 }
177
178 @override
179 String get errorCodeField => _errorCodeField ??= '';
180
181 /**
182 * The name of the error code field in the [errorCodeClass].
183 */
184 void set errorCodeField(String _value) {
185 assert(!_finished);
186 _errorCodeField = _value;
187 }
188
189 @override
190 int get length => _length ??= 0;
191
192 /**
193 * Length of the error range.
194 */
195 void set length(int _value) {
196 assert(!_finished);
197 assert(_value == null || _value >= 0);
198 _length = _value;
199 }
200
201 @override
202 String get message => _message ??= '';
203
204 /**
205 * The message to be displayed for this error. The message should indicate
206 * what is wrong and why it is wrong.
207 */
208 void set message(String _value) {
209 assert(!_finished);
210 _message = _value;
211 }
212
213 @override
214 int get offset => _offset ??= 0;
215
216 /**
217 * Offset of the error range relative to the beginning of the file.
218 */
219 void set offset(int _value) {
220 assert(!_finished);
221 assert(_value == null || _value >= 0);
222 _offset = _value;
223 }
224
225 CacheAnalysisErrorBuilder({String correction, String errorCodeClass, String er rorCodeField, int length, String message, int offset})
226 : _correction = correction,
227 _errorCodeClass = errorCodeClass,
228 _errorCodeField = errorCodeField,
229 _length = length,
230 _message = message,
231 _offset = offset;
232
233 /**
234 * Flush [informative] data recursively.
235 */
236 void flushInformative() {
237 }
238
239 fb.Offset finish(fb.Builder fbBuilder) {
240 assert(!_finished);
241 _finished = true;
242 fb.Offset offset_correction;
243 fb.Offset offset_errorCodeClass;
244 fb.Offset offset_errorCodeField;
245 fb.Offset offset_message;
246 if (_correction != null) {
247 offset_correction = fbBuilder.writeString(_correction);
248 }
249 if (_errorCodeClass != null) {
250 offset_errorCodeClass = fbBuilder.writeString(_errorCodeClass);
251 }
252 if (_errorCodeField != null) {
253 offset_errorCodeField = fbBuilder.writeString(_errorCodeField);
254 }
255 if (_message != null) {
256 offset_message = fbBuilder.writeString(_message);
257 }
258 fbBuilder.startTable();
259 if (offset_correction != null) {
260 fbBuilder.addOffset(5, offset_correction);
261 }
262 if (offset_errorCodeClass != null) {
263 fbBuilder.addOffset(0, offset_errorCodeClass);
264 }
265 if (offset_errorCodeField != null) {
266 fbBuilder.addOffset(1, offset_errorCodeField);
267 }
268 if (_length != null && _length != 0) {
269 fbBuilder.addUint32(3, _length);
270 }
271 if (offset_message != null) {
272 fbBuilder.addOffset(4, offset_message);
273 }
274 if (_offset != null && _offset != 0) {
275 fbBuilder.addUint32(2, _offset);
276 }
277 return fbBuilder.endTable();
278 }
279 }
280
281 class _CacheAnalysisErrorReader extends fb.TableReader<_CacheAnalysisErrorImpl> {
282 const _CacheAnalysisErrorReader();
283
284 @override
285 _CacheAnalysisErrorImpl createObject(fb.BufferContext bc, int offset) => new _ CacheAnalysisErrorImpl(bc, offset);
286 }
287
288 class _CacheAnalysisErrorImpl extends Object with _CacheAnalysisErrorMixin imple ments idl.CacheAnalysisError {
289 final fb.BufferContext _bc;
290 final int _bcOffset;
291
292 _CacheAnalysisErrorImpl(this._bc, this._bcOffset);
293
294 String _correction;
295 String _errorCodeClass;
296 String _errorCodeField;
297 int _length;
298 String _message;
299 int _offset;
300
301 @override
302 String get correction {
303 _correction ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 5, '');
304 return _correction;
305 }
306
307 @override
308 String get errorCodeClass {
309 _errorCodeClass ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 0, '') ;
310 return _errorCodeClass;
311 }
312
313 @override
314 String get errorCodeField {
315 _errorCodeField ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 1, '') ;
316 return _errorCodeField;
317 }
318
319 @override
320 int get length {
321 _length ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 3, 0);
322 return _length;
323 }
324
325 @override
326 String get message {
327 _message ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 4, '');
328 return _message;
329 }
330
331 @override
332 int get offset {
333 _offset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 2, 0);
334 return _offset;
335 }
336 }
337
338 abstract class _CacheAnalysisErrorMixin implements idl.CacheAnalysisError {
339 @override
340 Map<String, Object> toJson() {
341 Map<String, Object> _result = <String, Object>{};
342 if (correction != '') _result["correction"] = correction;
343 if (errorCodeClass != '') _result["errorCodeClass"] = errorCodeClass;
344 if (errorCodeField != '') _result["errorCodeField"] = errorCodeField;
345 if (length != 0) _result["length"] = length;
346 if (message != '') _result["message"] = message;
347 if (offset != 0) _result["offset"] = offset;
348 return _result;
349 }
350
351 @override
352 Map<String, Object> toMap() => {
353 "correction": correction,
354 "errorCodeClass": errorCodeClass,
355 "errorCodeField": errorCodeField,
356 "length": length,
357 "message": message,
358 "offset": offset,
359 };
360
361 @override
362 String toString() => convert.JSON.encode(toJson());
363 }
364
144 class CacheSourceContentBuilder extends Object with _CacheSourceContentMixin imp lements idl.CacheSourceContent { 365 class CacheSourceContentBuilder extends Object with _CacheSourceContentMixin imp lements idl.CacheSourceContent {
145 bool _finished = false; 366 bool _finished = false;
146 367
147 List<String> _exportedUris; 368 List<String> _exportedUris;
148 List<String> _importedUris; 369 List<String> _importedUris;
149 idl.CacheSourceKind _kind; 370 idl.CacheSourceKind _kind;
150 List<String> _partUris; 371 List<String> _partUris;
151 372
152 @override 373 @override
153 List<String> get exportedUris => _exportedUris ??= <String>[]; 374 List<String> get exportedUris => _exportedUris ??= <String>[];
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 "exportedUris": exportedUris, 530 "exportedUris": exportedUris,
310 "importedUris": importedUris, 531 "importedUris": importedUris,
311 "kind": kind, 532 "kind": kind,
312 "partUris": partUris, 533 "partUris": partUris,
313 }; 534 };
314 535
315 @override 536 @override
316 String toString() => convert.JSON.encode(toJson()); 537 String toString() => convert.JSON.encode(toJson());
317 } 538 }
318 539
540 class CacheSourceErrorsInLibraryBuilder extends Object with _CacheSourceErrorsIn LibraryMixin implements idl.CacheSourceErrorsInLibrary {
541 bool _finished = false;
542
543 List<CacheAnalysisErrorBuilder> _errors;
544
545 @override
546 List<CacheAnalysisErrorBuilder> get errors => _errors ??= <CacheAnalysisErrorB uilder>[];
547
548 /**
549 * The list of errors in the source in the library.
550 */
551 void set errors(List<CacheAnalysisErrorBuilder> _value) {
552 assert(!_finished);
553 _errors = _value;
554 }
555
556 CacheSourceErrorsInLibraryBuilder({List<CacheAnalysisErrorBuilder> errors})
557 : _errors = errors;
558
559 /**
560 * Flush [informative] data recursively.
561 */
562 void flushInformative() {
563 _errors?.forEach((b) => b.flushInformative());
564 }
565
566 List<int> toBuffer() {
567 fb.Builder fbBuilder = new fb.Builder();
568 return fbBuilder.finish(finish(fbBuilder), "CSEL");
569 }
570
571 fb.Offset finish(fb.Builder fbBuilder) {
572 assert(!_finished);
573 _finished = true;
574 fb.Offset offset_errors;
575 if (!(_errors == null || _errors.isEmpty)) {
576 offset_errors = fbBuilder.writeList(_errors.map((b) => b.finish(fbBuilder) ).toList());
577 }
578 fbBuilder.startTable();
579 if (offset_errors != null) {
580 fbBuilder.addOffset(0, offset_errors);
581 }
582 return fbBuilder.endTable();
583 }
584 }
585
586 idl.CacheSourceErrorsInLibrary readCacheSourceErrorsInLibrary(List<int> buffer) {
587 fb.BufferContext rootRef = new fb.BufferContext.fromBytes(buffer);
588 return const _CacheSourceErrorsInLibraryReader().read(rootRef, 0);
589 }
590
591 class _CacheSourceErrorsInLibraryReader extends fb.TableReader<_CacheSourceError sInLibraryImpl> {
592 const _CacheSourceErrorsInLibraryReader();
593
594 @override
595 _CacheSourceErrorsInLibraryImpl createObject(fb.BufferContext bc, int offset) => new _CacheSourceErrorsInLibraryImpl(bc, offset);
596 }
597
598 class _CacheSourceErrorsInLibraryImpl extends Object with _CacheSourceErrorsInLi braryMixin implements idl.CacheSourceErrorsInLibrary {
599 final fb.BufferContext _bc;
600 final int _bcOffset;
601
602 _CacheSourceErrorsInLibraryImpl(this._bc, this._bcOffset);
603
604 List<idl.CacheAnalysisError> _errors;
605
606 @override
607 List<idl.CacheAnalysisError> get errors {
608 _errors ??= const fb.ListReader<idl.CacheAnalysisError>(const _CacheAnalysis ErrorReader()).vTableGet(_bc, _bcOffset, 0, const <idl.CacheAnalysisError>[]);
609 return _errors;
610 }
611 }
612
613 abstract class _CacheSourceErrorsInLibraryMixin implements idl.CacheSourceErrors InLibrary {
614 @override
615 Map<String, Object> toJson() {
616 Map<String, Object> _result = <String, Object>{};
617 if (errors.isNotEmpty) _result["errors"] = errors.map((_value) => _value.toJ son()).toList();
618 return _result;
619 }
620
621 @override
622 Map<String, Object> toMap() => {
623 "errors": errors,
624 };
625
626 @override
627 String toString() => convert.JSON.encode(toJson());
628 }
629
319 class CodeRangeBuilder extends Object with _CodeRangeMixin implements idl.CodeRa nge { 630 class CodeRangeBuilder extends Object with _CodeRangeMixin implements idl.CodeRa nge {
320 bool _finished = false; 631 bool _finished = false;
321 632
322 int _length; 633 int _length;
323 int _offset; 634 int _offset;
324 635
325 @override 636 @override
326 int get length => _length ??= 0; 637 int get length => _length ??= 0;
327 638
328 /** 639 /**
(...skipping 8110 matching lines...) Expand 10 before | Expand all | Expand 10 after
8439 "propagatedTypeSlot": propagatedTypeSlot, 8750 "propagatedTypeSlot": propagatedTypeSlot,
8440 "type": type, 8751 "type": type,
8441 "visibleLength": visibleLength, 8752 "visibleLength": visibleLength,
8442 "visibleOffset": visibleOffset, 8753 "visibleOffset": visibleOffset,
8443 }; 8754 };
8444 8755
8445 @override 8756 @override
8446 String toString() => convert.JSON.encode(toJson()); 8757 String toString() => convert.JSON.encode(toJson());
8447 } 8758 }
8448 8759
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698