| OLD | NEW |
| 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 analyzer.src.generated.engine; | 5 library analyzer.src.generated.engine; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 | 9 |
| 10 import 'package:analyzer/dart/element/element.dart'; | 10 import 'package:analyzer/dart/element/element.dart'; |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 String toString() { | 668 String toString() { |
| 669 StringBuffer buffer = new StringBuffer(); | 669 StringBuffer buffer = new StringBuffer(); |
| 670 bool needsSeparator = _appendSources(buffer, false, AnalysisLevel.ALL); | 670 bool needsSeparator = _appendSources(buffer, false, AnalysisLevel.ALL); |
| 671 needsSeparator = | 671 needsSeparator = |
| 672 _appendSources(buffer, needsSeparator, AnalysisLevel.RESOLVED); | 672 _appendSources(buffer, needsSeparator, AnalysisLevel.RESOLVED); |
| 673 _appendSources(buffer, needsSeparator, AnalysisLevel.NONE); | 673 _appendSources(buffer, needsSeparator, AnalysisLevel.NONE); |
| 674 return buffer.toString(); | 674 return buffer.toString(); |
| 675 } | 675 } |
| 676 | 676 |
| 677 /** | 677 /** |
| 678 * Appendto the given [buffer] all sources with the given analysis [level], | 678 * Append to the given [buffer] all sources with the given analysis [level], |
| 679 * prefixed with a label and a separator if [needsSeparator] is `true`. | 679 * prefixed with a label and a separator if [needsSeparator] is `true`. |
| 680 */ | 680 */ |
| 681 bool _appendSources( | 681 bool _appendSources( |
| 682 StringBuffer buffer, bool needsSeparator, AnalysisLevel level) { | 682 StringBuffer buffer, bool needsSeparator, AnalysisLevel level) { |
| 683 bool first = true; | 683 bool first = true; |
| 684 _analysisMap.forEach((Source source, AnalysisLevel sourceLevel) { | 684 _analysisMap.forEach((Source source, AnalysisLevel sourceLevel) { |
| 685 if (sourceLevel == level) { | 685 if (sourceLevel == level) { |
| 686 if (first) { | 686 if (first) { |
| 687 first = false; | 687 first = false; |
| 688 if (needsSeparator) { | 688 if (needsSeparator) { |
| (...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1773 final int oldLength; | 1773 final int oldLength; |
| 1774 | 1774 |
| 1775 /** | 1775 /** |
| 1776 * The number of characters in the replacement text. | 1776 * The number of characters in the replacement text. |
| 1777 */ | 1777 */ |
| 1778 final int newLength; | 1778 final int newLength; |
| 1779 | 1779 |
| 1780 /** | 1780 /** |
| 1781 * Initialize a newly created change object to represent a change to the | 1781 * Initialize a newly created change object to represent a change to the |
| 1782 * content of a source. The [contents] is the new contents of the source. The | 1782 * content of a source. The [contents] is the new contents of the source. The |
| 1783 * [offse] ist the offset into the current contents. The [oldLength] is the | 1783 * [offset] ist the offset into the current contents. The [oldLength] is the |
| 1784 * number of characters in the original contents that were replaced. The | 1784 * number of characters in the original contents that were replaced. The |
| 1785 * [newLength] is the number of characters in the replacement text. | 1785 * [newLength] is the number of characters in the replacement text. |
| 1786 */ | 1786 */ |
| 1787 ChangeSet_ContentChange( | 1787 ChangeSet_ContentChange( |
| 1788 this.contents, this.offset, this.oldLength, this.newLength); | 1788 this.contents, this.offset, this.oldLength, this.newLength); |
| 1789 } | 1789 } |
| 1790 | 1790 |
| 1791 /** | 1791 /** |
| 1792 * [ComputedResult] describes a value computed for a [ResultDescriptor]. | 1792 * [ComputedResult] describes a value computed for a [ResultDescriptor]. |
| 1793 */ | 1793 */ |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2109 static PerformanceTag lint = new PerformanceTag('lint'); | 2109 static PerformanceTag lint = new PerformanceTag('lint'); |
| 2110 | 2110 |
| 2111 /** | 2111 /** |
| 2112 * The [PerformanceTag] for time spent computing cycles. | 2112 * The [PerformanceTag] for time spent computing cycles. |
| 2113 */ | 2113 */ |
| 2114 static PerformanceTag cycles = new PerformanceTag('cycles'); | 2114 static PerformanceTag cycles = new PerformanceTag('cycles'); |
| 2115 | 2115 |
| 2116 /** | 2116 /** |
| 2117 * The [PerformanceTag] for time spent in other phases of analysis. | 2117 * The [PerformanceTag] for time spent in other phases of analysis. |
| 2118 */ | 2118 */ |
| 2119 static PerformanceTag performAnaysis = new PerformanceTag('performAnaysis'); | 2119 static PerformanceTag performAnalysis = new PerformanceTag('performAnalysis'); |
| 2120 | 2120 |
| 2121 /** | 2121 /** |
| 2122 * The [PerformanceTag] for time spent in the analysis task visitor after | 2122 * The [PerformanceTag] for time spent in the analysis task visitor after |
| 2123 * tasks are complete. | 2123 * tasks are complete. |
| 2124 */ | 2124 */ |
| 2125 static PerformanceTag analysisTaskVisitor = | 2125 static PerformanceTag analysisTaskVisitor = |
| 2126 new PerformanceTag('analysisTaskVisitor'); | 2126 new PerformanceTag('analysisTaskVisitor'); |
| 2127 | 2127 |
| 2128 /** | 2128 /** |
| 2129 * The [PerformanceTag] for time spent in the getter | 2129 * The [PerformanceTag] for time spent in the getter |
| 2130 * AnalysisContextImpl.nextAnalysisTask. | 2130 * AnalysisContextImpl.nextAnalysisTask. |
| 2131 */ | 2131 */ |
| 2132 static var nextTask = new PerformanceTag('nextAnalysisTask'); | 2132 static var nextTask = new PerformanceTag('nextAnalysisTask'); |
| 2133 | 2133 |
| 2134 /** | 2134 /** |
| 2135 * The [PerformanceTag] for time spent during otherwise not accounted parts | 2135 * The [PerformanceTag] for time spent during otherwise not accounted parts |
| 2136 * incremental of analysis. | 2136 * incremental of analysis. |
| 2137 */ | 2137 */ |
| 2138 static PerformanceTag incrementalAnalysis = | 2138 static PerformanceTag incrementalAnalysis = |
| 2139 new PerformanceTag('incrementalAnalysis'); | 2139 new PerformanceTag('incrementalAnalysis'); |
| 2140 |
| 2141 /** |
| 2142 * The [PerformanceTag] for time spent in summaries support. |
| 2143 */ |
| 2144 static PerformanceTag summary = new PerformanceTag('summary'); |
| 2140 } | 2145 } |
| 2141 | 2146 |
| 2142 /** | 2147 /** |
| 2143 * An error listener that will record the errors that are reported to it in a | 2148 * An error listener that will record the errors that are reported to it in a |
| 2144 * way that is appropriate for caching those errors within an analysis context. | 2149 * way that is appropriate for caching those errors within an analysis context. |
| 2145 */ | 2150 */ |
| 2146 class RecordingErrorListener implements AnalysisErrorListener { | 2151 class RecordingErrorListener implements AnalysisErrorListener { |
| 2147 /** | 2152 /** |
| 2148 * A map of sets containing the errors that were collected, keyed by each | 2153 * A map of sets containing the errors that were collected, keyed by each |
| 2149 * source. | 2154 * source. |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2419 * The data that was created from the source. | 2424 * The data that was created from the source. |
| 2420 */ | 2425 */ |
| 2421 final E data; | 2426 final E data; |
| 2422 | 2427 |
| 2423 /** | 2428 /** |
| 2424 * Initialize a newly created holder to associate the given [data] with the | 2429 * Initialize a newly created holder to associate the given [data] with the |
| 2425 * given [modificationTime]. | 2430 * given [modificationTime]. |
| 2426 */ | 2431 */ |
| 2427 TimestampedData(this.modificationTime, this.data); | 2432 TimestampedData(this.modificationTime, this.data); |
| 2428 } | 2433 } |
| OLD | NEW |