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

Unified Diff: pkg/analyzer/lib/src/dart/analysis/driver.dart

Issue 2965533002: Use AnalysisDriver.getCachedResult() for 'implemented' notification. (Closed)
Patch Set: Created 3 years, 6 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
Index: pkg/analyzer/lib/src/dart/analysis/driver.dart
diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart
index d8c2527f92554c4c73e337398c165e19ee68a19c..8eba8dbefabce1ed1779e9a42626101d25987daa 100644
--- a/pkg/analyzer/lib/src/dart/analysis/driver.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart
@@ -539,6 +539,23 @@ class AnalysisDriver implements AnalysisDriverGeneric {
}
/**
+ * Return the cached [AnalysisResult] for the Dart file with the given [path].
+ * If there is no cached result, return `null`. Usually only results of
+ * priority files are cached.
+ *
+ * The [path] must be absolute and normalized.
+ *
+ * The [path] can be any file - explicitly or implicitly analyzed, or neither.
+ */
+ AnalysisResult getCachedResult(String path) {
+ AnalysisResult result = _priorityResults[path];
+ if (disableChangesAndCacheAllResults) {
+ result ??= _allCachedResults[path];
+ }
+ return result;
+ }
+
+ /**
* Return a [Future] that completes with the [ErrorsResult] for the Dart
* file with the given [path]. If the file is not a Dart file or cannot
* be analyzed, the [Future] completes with `null`.
@@ -666,10 +683,7 @@ class AnalysisDriver implements AnalysisDriverGeneric {
// Return the cached result.
{
- AnalysisResult result = _priorityResults[path];
- if (disableChangesAndCacheAllResults) {
- result ??= _allCachedResults[path];
- }
+ AnalysisResult result = getCachedResult(path);
if (result != null) {
return new Future.value(result);
}
« no previous file with comments | « pkg/analysis_server/test/analysis_abstract.dart ('k') | pkg/analyzer/test/src/dart/analysis/driver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698