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

Unified Diff: pkg/analyzer/lib/src/generated/engine.dart

Issue 1308033008: Add AnalysisContext.getResult()/computeResult() (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/context/context.dart ('k') | pkg/analyzer/test/generated/engine_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/engine.dart
diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
index 763801436d9fe041d7ac4aed5e07318b8a140754..0e8f9c831b9d99678f39e38a5996be780e3cc176 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -553,6 +553,12 @@ abstract class AnalysisContext {
Source source, Source librarySource);
/**
+ * Perform work until the given [result] has been computed for the given
+ * [target]. Return the computed value.
+ */
+ Object /*V*/ computeResult(AnalysisTarget target, ResultDescriptor /*<V>*/ result);
+
+ /**
* Notifies the context that the client is going to stop using this context.
*/
void dispose();
@@ -718,6 +724,14 @@ abstract class AnalysisContext {
ht.HtmlUnit getResolvedHtmlUnit(Source htmlSource);
/**
+ * Return the value of the given [result] for the given [target].
+ *
+ * If the corresponding [target] does not exist, or the [result] is not
+ * computed yet, then the default value is returned.
+ */
+ Object /*V*/ getResult(AnalysisTarget target, ResultDescriptor /*<V>*/ result);
+
+ /**
* Return a list of the sources being analyzed in this context whose full path
* is equal to the given [path].
*/
@@ -1805,6 +1819,11 @@ class AnalysisContextImpl implements InternalAnalysisContext {
});
}
+ @override
+ Object computeResult(AnalysisTarget target, ResultDescriptor result) {
+ return result.defaultValue;
+ }
+
/**
* Create an analysis cache based on the given source [factory].
*/
@@ -2183,6 +2202,11 @@ class AnalysisContextImpl implements InternalAnalysisContext {
}
@override
+ Object getResult(AnalysisTarget target, ResultDescriptor result) {
+ return result.defaultValue;
+ }
+
+ @override
List<Source> getSourcesWithFullName(String path) {
List<Source> sources = <Source>[];
MapIterator<Source, SourceEntry> iterator = _cache.iterator();
@@ -4169,23 +4193,6 @@ class AnalysisContextImpl implements InternalAnalysisContext {
bool _isTooBigHtmlSourceEntry(Source source, SourceEntry sourceEntry) =>
false;
- /**
- * Log the given debugging [message].
- */
- void _logInformation(String message) {
- AnalysisEngine.instance.logger.logInformation(message);
- }
-
- /**
- * Notify all of the analysis listeners that a task is about to be performed.
- */
- void _notifyAboutToPerformTask(String taskDescription) {
- int count = _listeners.length;
- for (int i = 0; i < count; i++) {
- _listeners[i].aboutToPerformTask(this, taskDescription);
- }
- }
-
// /**
// * Notify all of the analysis listeners that the given source is no longer included in the set of
// * sources that are being analyzed.
@@ -4265,6 +4272,23 @@ class AnalysisContextImpl implements InternalAnalysisContext {
// }
/**
+ * Log the given debugging [message].
+ */
+ void _logInformation(String message) {
+ AnalysisEngine.instance.logger.logInformation(message);
+ }
+
+ /**
+ * Notify all of the analysis listeners that a task is about to be performed.
+ */
+ void _notifyAboutToPerformTask(String taskDescription) {
+ int count = _listeners.length;
+ for (int i = 0; i < count; i++) {
+ _listeners[i].aboutToPerformTask(this, taskDescription);
+ }
+ }
+
+ /**
* Notify all of the analysis listeners that the errors associated with the
* given [source] has been updated to the given [errors].
*/
« no previous file with comments | « pkg/analyzer/lib/src/context/context.dart ('k') | pkg/analyzer/test/generated/engine_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698