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

Unified Diff: pkg/analyzer/lib/src/context/context.dart

Issue 1403033002: State-carrying context API. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fixes and tests. Created 5 years, 2 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 | « no previous file | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/context/context.dart
diff --git a/pkg/analyzer/lib/src/context/context.dart b/pkg/analyzer/lib/src/context/context.dart
index b2c2471d7a7372ca5d30f15bbe52bef073a56693..1aaa6911fac75e27c9f0d73fd8a892b8f0219587 100644
--- a/pkg/analyzer/lib/src/context/context.dart
+++ b/pkg/analyzer/lib/src/context/context.dart
@@ -115,6 +115,12 @@ class AnalysisContextImpl implements InternalAnalysisContext {
AnalysisCache _cache;
/**
+ * Configuration data associated with this context.
+ */
+ final HashMap<ResultDescriptor, Object> _configurationData =
+ new HashMap<ResultDescriptor, Object>();
+
+ /**
* The task manager used to manage the tasks used to analyze code.
*/
TaskManager _taskManager;
@@ -764,6 +770,9 @@ class AnalysisContextImpl implements InternalAnalysisContext {
}
@override
+ Object getConfigurationData(ResultDescriptor key) => _configurationData[key];
+
+ @override
TimestampedData<String> getContents(Source source) {
String contents = _contentCache.getContents(source);
if (contents != null) {
@@ -1201,6 +1210,11 @@ class AnalysisContextImpl implements InternalAnalysisContext {
}
@override
+ void setConfigurationData(ResultDescriptor key, Object data) {
+ _configurationData[key] = data;
+ }
+
+ @override
void setContents(Source source, String contents) {
_contentsChanged(source, contents, true);
}
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698