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

Side by Side Diff: pkg/analyzer/lib/src/generated/engine.dart

Issue 876703003: Issue 22155. Send outline for both parsed and resolved Dart units. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 | Annotate | Revision Log
« no previous file with comments | « pkg/analysis_server/lib/src/operation/operation_analysis.dart ('k') | no next file » | 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) 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 engine; 8 library engine;
9 9
10 import "dart:math" as math; 10 import "dart:math" as math;
(...skipping 2353 matching lines...) Expand 10 before | Expand all | Expand 10 after
2364 } else { 2364 } else {
2365 dartEntry.recordResolutionErrorInLibrary( 2365 dartEntry.recordResolutionErrorInLibrary(
2366 librarySource, 2366 librarySource,
2367 thrownException); 2367 thrownException);
2368 } 2368 }
2369 if (source != librarySource) { 2369 if (source != librarySource) {
2370 _workManager.add(source, SourcePriority.PRIORITY_PART); 2370 _workManager.add(source, SourcePriority.PRIORITY_PART);
2371 } 2371 }
2372 ChangeNoticeImpl notice = _getNotice(source); 2372 ChangeNoticeImpl notice = _getNotice(source);
2373 notice.compilationUnit = unit; 2373 notice.compilationUnit = unit;
2374 notice.resolved = true;
2375 notice.setErrors(dartEntry.allErrors, lineInfo); 2374 notice.setErrors(dartEntry.allErrors, lineInfo);
2376 } 2375 }
2377 } 2376 }
2378 } 2377 }
2379 if (thrownException != null) { 2378 if (thrownException != null) {
2380 throw new AnalysisException('<rethrow>', thrownException); 2379 throw new AnalysisException('<rethrow>', thrownException);
2381 } 2380 }
2382 return unitEntry; 2381 return unitEntry;
2383 } 2382 }
2384 2383
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
2449 dartEntry.recordResolutionErrorInLibrary( 2448 dartEntry.recordResolutionErrorInLibrary(
2450 librarySource, 2449 librarySource,
2451 thrownException); 2450 thrownException);
2452 _cache.remove(source); 2451 _cache.remove(source);
2453 } 2452 }
2454 if (source != librarySource) { 2453 if (source != librarySource) {
2455 _workManager.add(source, SourcePriority.PRIORITY_PART); 2454 _workManager.add(source, SourcePriority.PRIORITY_PART);
2456 } 2455 }
2457 ChangeNoticeImpl notice = _getNotice(source); 2456 ChangeNoticeImpl notice = _getNotice(source);
2458 notice.compilationUnit = unit; 2457 notice.compilationUnit = unit;
2459 notice.resolved = true;
2460 notice.setErrors(dartEntry.allErrors, lineInfo); 2458 notice.setErrors(dartEntry.allErrors, lineInfo);
2461 } 2459 }
2462 } 2460 }
2463 } 2461 }
2464 if (thrownException != null) { 2462 if (thrownException != null) {
2465 throw new AnalysisException('<rethrow>', thrownException); 2463 throw new AnalysisException('<rethrow>', thrownException);
2466 } 2464 }
2467 return unitEntry; 2465 return unitEntry;
2468 } 2466 }
2469 2467
(...skipping 2152 matching lines...) Expand 10 before | Expand all | Expand 10 after
4622 * @param task the task that was performed 4620 * @param task the task that was performed
4623 * @return an entry containing the computed results 4621 * @return an entry containing the computed results
4624 * @throws AnalysisException if the results could not be recorded 4622 * @throws AnalysisException if the results could not be recorded
4625 */ 4623 */
4626 DartEntry 4624 DartEntry
4627 _recordIncrementalAnalysisTaskResults(IncrementalAnalysisTask task) { 4625 _recordIncrementalAnalysisTaskResults(IncrementalAnalysisTask task) {
4628 CompilationUnit unit = task.compilationUnit; 4626 CompilationUnit unit = task.compilationUnit;
4629 if (unit != null) { 4627 if (unit != null) {
4630 ChangeNoticeImpl notice = _getNotice(task.source); 4628 ChangeNoticeImpl notice = _getNotice(task.source);
4631 notice.compilationUnit = unit; 4629 notice.compilationUnit = unit;
4632 notice.resolved = true;
4633 _incrementalAnalysisCache = 4630 _incrementalAnalysisCache =
4634 IncrementalAnalysisCache.cacheResult(task.cache, unit); 4631 IncrementalAnalysisCache.cacheResult(task.cache, unit);
4635 } 4632 }
4636 return null; 4633 return null;
4637 } 4634 }
4638 4635
4639 /** 4636 /**
4640 * Record the results produced by performing a [task] and return the cache 4637 * Record the results produced by performing a [task] and return the cache
4641 * entry associated with the results. 4638 * entry associated with the results.
4642 */ 4639 */
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
4684 } 4681 }
4685 } 4682 }
4686 dartEntry.setValue(DartEntry.PARSED_UNIT, task.compilationUnit); 4683 dartEntry.setValue(DartEntry.PARSED_UNIT, task.compilationUnit);
4687 dartEntry.setValue(DartEntry.PARSE_ERRORS, task.errors); 4684 dartEntry.setValue(DartEntry.PARSE_ERRORS, task.errors);
4688 dartEntry.setValue(DartEntry.EXPORTED_LIBRARIES, task.exportedSources); 4685 dartEntry.setValue(DartEntry.EXPORTED_LIBRARIES, task.exportedSources);
4689 dartEntry.setValue(DartEntry.IMPORTED_LIBRARIES, task.importedSources); 4686 dartEntry.setValue(DartEntry.IMPORTED_LIBRARIES, task.importedSources);
4690 dartEntry.setValue(DartEntry.INCLUDED_PARTS, newParts); 4687 dartEntry.setValue(DartEntry.INCLUDED_PARTS, newParts);
4691 _cache.storedAst(source); 4688 _cache.storedAst(source);
4692 ChangeNoticeImpl notice = _getNotice(source); 4689 ChangeNoticeImpl notice = _getNotice(source);
4693 if (notice.compilationUnit == null) { 4690 if (notice.compilationUnit == null) {
4694 notice.compilationUnit = task.compilationUnit; 4691 notice.parsedDartUnit = task.compilationUnit;
4695 notice.resolved = false;
4696 } 4692 }
4697 notice.setErrors(dartEntry.allErrors, task.lineInfo); 4693 notice.setErrors(dartEntry.allErrors, task.lineInfo);
4698 // Verify that the incrementally parsed and resolved unit in the incremental 4694 // Verify that the incrementally parsed and resolved unit in the incremental
4699 // cache is structurally equivalent to the fully parsed unit 4695 // cache is structurally equivalent to the fully parsed unit
4700 _incrementalAnalysisCache = IncrementalAnalysisCache.verifyStructure( 4696 _incrementalAnalysisCache = IncrementalAnalysisCache.verifyStructure(
4701 _incrementalAnalysisCache, 4697 _incrementalAnalysisCache,
4702 source, 4698 source,
4703 task.compilationUnit); 4699 task.compilationUnit);
4704 return dartEntry; 4700 return dartEntry;
4705 } 4701 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
4765 _cache.removedAst(source); 4761 _cache.removedAst(source);
4766 throw new AnalysisException('<rethrow>', thrownException); 4762 throw new AnalysisException('<rethrow>', thrownException);
4767 } 4763 }
4768 htmlEntry.setState(HtmlEntry.PARSED_UNIT, CacheState.FLUSHED); 4764 htmlEntry.setState(HtmlEntry.PARSED_UNIT, CacheState.FLUSHED);
4769 htmlEntry.setValue(HtmlEntry.RESOLVED_UNIT, task.resolvedUnit); 4765 htmlEntry.setValue(HtmlEntry.RESOLVED_UNIT, task.resolvedUnit);
4770 htmlEntry.setValue(HtmlEntry.ELEMENT, task.element); 4766 htmlEntry.setValue(HtmlEntry.ELEMENT, task.element);
4771 htmlEntry.setValue(HtmlEntry.RESOLUTION_ERRORS, task.resolutionErrors); 4767 htmlEntry.setValue(HtmlEntry.RESOLUTION_ERRORS, task.resolutionErrors);
4772 _cache.storedAst(source); 4768 _cache.storedAst(source);
4773 ChangeNoticeImpl notice = _getNotice(source); 4769 ChangeNoticeImpl notice = _getNotice(source);
4774 notice.htmlUnit = task.resolvedUnit; 4770 notice.htmlUnit = task.resolvedUnit;
4775 notice.resolved = true;
4776 LineInfo lineInfo = htmlEntry.getValue(SourceEntry.LINE_INFO); 4771 LineInfo lineInfo = htmlEntry.getValue(SourceEntry.LINE_INFO);
4777 notice.setErrors(htmlEntry.allErrors, lineInfo); 4772 notice.setErrors(htmlEntry.allErrors, lineInfo);
4778 return htmlEntry; 4773 return htmlEntry;
4779 } 4774 }
4780 4775
4781 /** 4776 /**
4782 * Record the results produced by performing a [task] and return the cache 4777 * Record the results produced by performing a [task] and return the cache
4783 * entry associated with the results. 4778 * entry associated with the results.
4784 */ 4779 */
4785 DartEntry _recordScanDartTaskResults(ScanDartTask task) { 4780 DartEntry _recordScanDartTaskResults(ScanDartTask task) {
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
5063 oldUnit.element.library.source; 5058 oldUnit.element.library.source;
5064 incrementalResolutionValidation_lastUnit = oldUnit; 5059 incrementalResolutionValidation_lastUnit = oldUnit;
5065 return false; 5060 return false;
5066 } 5061 }
5067 // prepare notices 5062 // prepare notices
5068 units.forEach((Source source, CompilationUnit unit) { 5063 units.forEach((Source source, CompilationUnit unit) {
5069 DartEntry dartEntry = _cache.get(source); 5064 DartEntry dartEntry = _cache.get(source);
5070 LineInfo lineInfo = getLineInfo(source); 5065 LineInfo lineInfo = getLineInfo(source);
5071 ChangeNoticeImpl notice = _getNotice(source); 5066 ChangeNoticeImpl notice = _getNotice(source);
5072 notice.compilationUnit = unit; 5067 notice.compilationUnit = unit;
5073 notice.resolved = true;
5074 notice.setErrors(dartEntry.allErrors, lineInfo); 5068 notice.setErrors(dartEntry.allErrors, lineInfo);
5075 }); 5069 });
5076 // OK 5070 // OK
5077 return true; 5071 return true;
5078 } 5072 }
5079 5073
5080 /** 5074 /**
5081 * Check the cache for any invalid entries (entries whose modification time do es not match the 5075 * Check the cache for any invalid entries (entries whose modification time do es not match the
5082 * modification time of the source associated with the entry). Invalid entries will be marked as 5076 * modification time of the source associated with the entry). Invalid entries will be marked as
5083 * invalid so that the source will be re-analyzed. 5077 * invalid so that the source will be re-analyzed.
(...skipping 2155 matching lines...) Expand 10 before | Expand all | Expand 10 after
7239 7233
7240 const CacheState(String name, int ordinal) : super(name, ordinal); 7234 const CacheState(String name, int ordinal) : super(name, ordinal);
7241 } 7235 }
7242 7236
7243 /** 7237 /**
7244 * An object that represents a change to the analysis results associated with a 7238 * An object that represents a change to the analysis results associated with a
7245 * given source. 7239 * given source.
7246 */ 7240 */
7247 abstract class ChangeNotice implements AnalysisErrorInfo { 7241 abstract class ChangeNotice implements AnalysisErrorInfo {
7248 /** 7242 /**
7249 * Return the AST that changed as a result of the analysis, or `null` if the 7243 * The parsed, but maybe not resolved Dart AST that changed as a result of
7250 * AST was not changed. Use the getter [resolved] to determine whether the 7244 * the analysis, or `null` if the AST was not changed.
7251 * AST has been fully resolved. 7245 */
7246 CompilationUnit get parsedDartUnit;
7247
7248 /**
7249 * The fully resolved Dart AST that changed as a result of the analysis, or
7250 * `null` if the AST was not changed.
7252 */ 7251 */
7253 CompilationUnit get compilationUnit; 7252 CompilationUnit get compilationUnit;
Brian Wilkerson 2015/01/26 19:11:03 Should we change the name to "resolvedDartUnit" fo
7254 7253
7255 /** 7254 /**
7256 * Return the HTML that changed as a result of the analysis, or `null` if the 7255 * The fully resolved HTML AST that changed as a result of the analysis, or
7257 * HTML was not changed. Use the getter [resolved] to determine whether the 7256 * `null` if the AST was not changed.
7258 * HTML has been fully resolved.
7259 */ 7257 */
7260 ht.HtmlUnit get htmlUnit; 7258 ht.HtmlUnit get htmlUnit;
Brian Wilkerson 2015/01/26 19:11:03 "resolvedHtmlUnit"?
7261 7259
7262 /** 7260 /**
7263 * Return `true` if the [compilationUnit] or [htmlUnit] (whichever is
7264 * currently set) has been resolved.
7265 */
7266 bool get resolved;
7267
7268 /**
7269 * Return the source for which the result is being reported. 7261 * Return the source for which the result is being reported.
7270 */ 7262 */
7271 Source get source; 7263 Source get source;
7272 } 7264 }
7273 7265
7274 /** 7266 /**
7275 * An implementation of a [ChangeNotice]. 7267 * An implementation of a [ChangeNotice].
7276 */ 7268 */
7277 class ChangeNoticeImpl implements ChangeNotice { 7269 class ChangeNoticeImpl implements ChangeNotice {
7278 /** 7270 /**
7279 * An empty list of change notices. 7271 * An empty list of change notices.
7280 */ 7272 */
7281 static const List<ChangeNoticeImpl> EMPTY_ARRAY = const <ChangeNoticeImpl>[]; 7273 static const List<ChangeNoticeImpl> EMPTY_ARRAY = const <ChangeNoticeImpl>[];
7282 7274
7283 /** 7275 /**
7284 * The source for which the result is being reported. 7276 * The source for which the result is being reported.
7285 */ 7277 */
7286 final Source source; 7278 final Source source;
7287 7279
7288 /** 7280 /**
7289 * The AST that changed as a result of the analysis, or `null` if the AST was 7281 * The parsed, but maybe not resolved Dart AST that changed as a result of
7290 * not changed. Use the getter [resolved] to determine whether the AST has 7282 * the analysis, or `null` if the AST was not changed.
7291 * been fully resolved. 7283 */
7284 CompilationUnit parsedDartUnit;
7285
7286 /**
7287 * The fully resolved Dart AST that changed as a result of the analysis, or
7288 * `null` if the AST was not changed.
7292 */ 7289 */
7293 CompilationUnit compilationUnit; 7290 CompilationUnit compilationUnit;
7294 7291
7295 /** 7292 /**
7296 * The HTML that changed as a result of the analysis, or `null` if the HTML 7293 * The fully resolved HTML AST that changed as a result of the analysis, or
7297 * was not changed. Use the getter [resolved] to determine whether the HTML 7294 * `null` if the AST was not changed.
7298 * has been fully resolved.
7299 */ 7295 */
7300 ht.HtmlUnit htmlUnit; 7296 ht.HtmlUnit htmlUnit;
7301 7297
7302 /** 7298 /**
7303 * A flag indicating whether the [compilationUnit] or [htmlUnit] (whichever is
7304 * currently set) has been resolved.
7305 */
7306 bool resolved = false;
7307
7308 /**
7309 * The errors that changed as a result of the analysis, or `null` if errors 7299 * The errors that changed as a result of the analysis, or `null` if errors
7310 * were not changed. 7300 * were not changed.
7311 */ 7301 */
7312 List<AnalysisError> _errors; 7302 List<AnalysisError> _errors;
7313 7303
7314 /** 7304 /**
7315 * The line information associated with the source, or `null` if errors were 7305 * The line information associated with the source, or `null` if errors were
7316 * not changed. 7306 * not changed.
7317 */ 7307 */
7318 LineInfo _lineInfo; 7308 LineInfo _lineInfo;
(...skipping 4969 matching lines...) Expand 10 before | Expand all | Expand 10 after
12288 if (element.id == _id) { 12278 if (element.id == _id) {
12289 result = element; 12279 result = element;
12290 throw new _ElementByIdFinderException(); 12280 throw new _ElementByIdFinderException();
12291 } 12281 }
12292 super.visitElement(element); 12282 super.visitElement(element);
12293 } 12283 }
12294 } 12284 }
12295 12285
12296 class _ElementByIdFinderException { 12286 class _ElementByIdFinderException {
12297 } 12287 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/operation/operation_analysis.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698