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

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

Issue 2663903002: Store exceptions with transitive files context into ByteStore. (Closed)
Patch Set: Created 3 years, 10 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 @override 122 @override
123 int get size => 1; 123 int get size => 1;
124 124
125 @override 125 @override
126 idl.UnlinkedParamKind read(fb.BufferContext bc, int offset) { 126 idl.UnlinkedParamKind read(fb.BufferContext bc, int offset) {
127 int index = const fb.Uint8Reader().read(bc, offset); 127 int index = const fb.Uint8Reader().read(bc, offset);
128 return index < idl.UnlinkedParamKind.values.length ? idl.UnlinkedParamKind.v alues[index] : idl.UnlinkedParamKind.required; 128 return index < idl.UnlinkedParamKind.values.length ? idl.UnlinkedParamKind.v alues[index] : idl.UnlinkedParamKind.required;
129 } 129 }
130 } 130 }
131 131
132 class AnalysisDriverExceptionContextBuilder extends Object with _AnalysisDriverE xceptionContextMixin implements idl.AnalysisDriverExceptionContext {
133 String _exception;
134 List<AnalysisDriverExceptionFileBuilder> _files;
135 String _path;
136 String _stackTrace;
137
138 @override
139 String get exception => _exception ??= '';
140
141 /**
142 * The exception string.
143 */
144 void set exception(String value) {
145 this._exception = value;
146 }
147
148 @override
149 List<AnalysisDriverExceptionFileBuilder> get files => _files ??= <AnalysisDriv erExceptionFileBuilder>[];
150
151 /**
152 * The state of files when the exception happened.
153 */
154 void set files(List<AnalysisDriverExceptionFileBuilder> value) {
155 this._files = value;
156 }
157
158 @override
159 String get path => _path ??= '';
160
161 /**
162 * The path of the file being analyzed when the exception happened.
163 */
164 void set path(String value) {
165 this._path = value;
166 }
167
168 @override
169 String get stackTrace => _stackTrace ??= '';
170
171 /**
172 * The exception stack trace string.
173 */
174 void set stackTrace(String value) {
175 this._stackTrace = value;
176 }
177
178 AnalysisDriverExceptionContextBuilder({String exception, List<AnalysisDriverEx ceptionFileBuilder> files, String path, String stackTrace})
179 : _exception = exception,
180 _files = files,
181 _path = path,
182 _stackTrace = stackTrace;
183
184 /**
185 * Flush [informative] data recursively.
186 */
187 void flushInformative() {
188 _files?.forEach((b) => b.flushInformative());
189 }
190
191 /**
192 * Accumulate non-[informative] data into [signature].
193 */
194 void collectApiSignature(api_sig.ApiSignature signature) {
195 signature.addString(this._path ?? '');
196 signature.addString(this._exception ?? '');
197 signature.addString(this._stackTrace ?? '');
198 if (this._files == null) {
199 signature.addInt(0);
200 } else {
201 signature.addInt(this._files.length);
202 for (var x in this._files) {
203 x?.collectApiSignature(signature);
204 }
205 }
206 }
207
208 List<int> toBuffer() {
209 fb.Builder fbBuilder = new fb.Builder();
210 return fbBuilder.finish(finish(fbBuilder), "ADEC");
211 }
212
213 fb.Offset finish(fb.Builder fbBuilder) {
214 fb.Offset offset_exception;
215 fb.Offset offset_files;
216 fb.Offset offset_path;
217 fb.Offset offset_stackTrace;
218 if (_exception != null) {
219 offset_exception = fbBuilder.writeString(_exception);
220 }
221 if (!(_files == null || _files.isEmpty)) {
222 offset_files = fbBuilder.writeList(_files.map((b) => b.finish(fbBuilder)). toList());
223 }
224 if (_path != null) {
225 offset_path = fbBuilder.writeString(_path);
226 }
227 if (_stackTrace != null) {
228 offset_stackTrace = fbBuilder.writeString(_stackTrace);
229 }
230 fbBuilder.startTable();
231 if (offset_exception != null) {
232 fbBuilder.addOffset(1, offset_exception);
233 }
234 if (offset_files != null) {
235 fbBuilder.addOffset(3, offset_files);
236 }
237 if (offset_path != null) {
238 fbBuilder.addOffset(0, offset_path);
239 }
240 if (offset_stackTrace != null) {
241 fbBuilder.addOffset(2, offset_stackTrace);
242 }
243 return fbBuilder.endTable();
244 }
245 }
246
247 idl.AnalysisDriverExceptionContext readAnalysisDriverExceptionContext(List<int> buffer) {
248 fb.BufferContext rootRef = new fb.BufferContext.fromBytes(buffer);
249 return const _AnalysisDriverExceptionContextReader().read(rootRef, 0);
250 }
251
252 class _AnalysisDriverExceptionContextReader extends fb.TableReader<_AnalysisDriv erExceptionContextImpl> {
253 const _AnalysisDriverExceptionContextReader();
254
255 @override
256 _AnalysisDriverExceptionContextImpl createObject(fb.BufferContext bc, int offs et) => new _AnalysisDriverExceptionContextImpl(bc, offset);
257 }
258
259 class _AnalysisDriverExceptionContextImpl extends Object with _AnalysisDriverExc eptionContextMixin implements idl.AnalysisDriverExceptionContext {
260 final fb.BufferContext _bc;
261 final int _bcOffset;
262
263 _AnalysisDriverExceptionContextImpl(this._bc, this._bcOffset);
264
265 String _exception;
266 List<idl.AnalysisDriverExceptionFile> _files;
267 String _path;
268 String _stackTrace;
269
270 @override
271 String get exception {
272 _exception ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 1, '');
273 return _exception;
274 }
275
276 @override
277 List<idl.AnalysisDriverExceptionFile> get files {
278 _files ??= const fb.ListReader<idl.AnalysisDriverExceptionFile>(const _Analy sisDriverExceptionFileReader()).vTableGet(_bc, _bcOffset, 3, const <idl.Analysis DriverExceptionFile>[]);
279 return _files;
280 }
281
282 @override
283 String get path {
284 _path ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 0, '');
285 return _path;
286 }
287
288 @override
289 String get stackTrace {
290 _stackTrace ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 2, '');
291 return _stackTrace;
292 }
293 }
294
295 abstract class _AnalysisDriverExceptionContextMixin implements idl.AnalysisDrive rExceptionContext {
296 @override
297 Map<String, Object> toJson() {
298 Map<String, Object> _result = <String, Object>{};
299 if (exception != '') _result["exception"] = exception;
300 if (files.isNotEmpty) _result["files"] = files.map((_value) => _value.toJson ()).toList();
301 if (path != '') _result["path"] = path;
302 if (stackTrace != '') _result["stackTrace"] = stackTrace;
303 return _result;
304 }
305
306 @override
307 Map<String, Object> toMap() => {
308 "exception": exception,
309 "files": files,
310 "path": path,
311 "stackTrace": stackTrace,
312 };
313
314 @override
315 String toString() => convert.JSON.encode(toJson());
316 }
317
318 class AnalysisDriverExceptionFileBuilder extends Object with _AnalysisDriverExce ptionFileMixin implements idl.AnalysisDriverExceptionFile {
319 String _content;
320 String _path;
321
322 @override
323 String get content => _content ??= '';
324
325 /**
326 * The content of the file.
327 */
328 void set content(String value) {
329 this._content = value;
330 }
331
332 @override
333 String get path => _path ??= '';
334
335 /**
336 * The path of the file.
337 */
338 void set path(String value) {
339 this._path = value;
340 }
341
342 AnalysisDriverExceptionFileBuilder({String content, String path})
343 : _content = content,
344 _path = path;
345
346 /**
347 * Flush [informative] data recursively.
348 */
349 void flushInformative() {
350 }
351
352 /**
353 * Accumulate non-[informative] data into [signature].
354 */
355 void collectApiSignature(api_sig.ApiSignature signature) {
356 signature.addString(this._path ?? '');
357 signature.addString(this._content ?? '');
358 }
359
360 fb.Offset finish(fb.Builder fbBuilder) {
361 fb.Offset offset_content;
362 fb.Offset offset_path;
363 if (_content != null) {
364 offset_content = fbBuilder.writeString(_content);
365 }
366 if (_path != null) {
367 offset_path = fbBuilder.writeString(_path);
368 }
369 fbBuilder.startTable();
370 if (offset_content != null) {
371 fbBuilder.addOffset(1, offset_content);
372 }
373 if (offset_path != null) {
374 fbBuilder.addOffset(0, offset_path);
375 }
376 return fbBuilder.endTable();
377 }
378 }
379
380 class _AnalysisDriverExceptionFileReader extends fb.TableReader<_AnalysisDriverE xceptionFileImpl> {
381 const _AnalysisDriverExceptionFileReader();
382
383 @override
384 _AnalysisDriverExceptionFileImpl createObject(fb.BufferContext bc, int offset) => new _AnalysisDriverExceptionFileImpl(bc, offset);
385 }
386
387 class _AnalysisDriverExceptionFileImpl extends Object with _AnalysisDriverExcept ionFileMixin implements idl.AnalysisDriverExceptionFile {
388 final fb.BufferContext _bc;
389 final int _bcOffset;
390
391 _AnalysisDriverExceptionFileImpl(this._bc, this._bcOffset);
392
393 String _content;
394 String _path;
395
396 @override
397 String get content {
398 _content ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 1, '');
399 return _content;
400 }
401
402 @override
403 String get path {
404 _path ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 0, '');
405 return _path;
406 }
407 }
408
409 abstract class _AnalysisDriverExceptionFileMixin implements idl.AnalysisDriverEx ceptionFile {
410 @override
411 Map<String, Object> toJson() {
412 Map<String, Object> _result = <String, Object>{};
413 if (content != '') _result["content"] = content;
414 if (path != '') _result["path"] = path;
415 return _result;
416 }
417
418 @override
419 Map<String, Object> toMap() => {
420 "content": content,
421 "path": path,
422 };
423
424 @override
425 String toString() => convert.JSON.encode(toJson());
426 }
427
132 class AnalysisDriverResolvedUnitBuilder extends Object with _AnalysisDriverResol vedUnitMixin implements idl.AnalysisDriverResolvedUnit { 428 class AnalysisDriverResolvedUnitBuilder extends Object with _AnalysisDriverResol vedUnitMixin implements idl.AnalysisDriverResolvedUnit {
133 List<AnalysisDriverUnitErrorBuilder> _errors; 429 List<AnalysisDriverUnitErrorBuilder> _errors;
134 AnalysisDriverUnitIndexBuilder _index; 430 AnalysisDriverUnitIndexBuilder _index;
135 431
136 @override 432 @override
137 List<AnalysisDriverUnitErrorBuilder> get errors => _errors ??= <AnalysisDriver UnitErrorBuilder>[]; 433 List<AnalysisDriverUnitErrorBuilder> get errors => _errors ??= <AnalysisDriver UnitErrorBuilder>[];
138 434
139 /** 435 /**
140 * The full list of analysis errors, both syntactic and semantic. 436 * The full list of analysis errors, both syntactic and semantic.
141 */ 437 */
(...skipping 10631 matching lines...) Expand 10 before | Expand all | Expand 10 after
10773 "propagatedTypeSlot": propagatedTypeSlot, 11069 "propagatedTypeSlot": propagatedTypeSlot,
10774 "type": type, 11070 "type": type,
10775 "visibleLength": visibleLength, 11071 "visibleLength": visibleLength,
10776 "visibleOffset": visibleOffset, 11072 "visibleOffset": visibleOffset,
10777 }; 11073 };
10778 11074
10779 @override 11075 @override
10780 String toString() => convert.JSON.encode(toJson()); 11076 String toString() => convert.JSON.encode(toJson());
10781 } 11077 }
10782 11078
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698