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

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

Issue 2956193003: Implement search for direct subtypes in a single AnalysisDriver. (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
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/dart/analysis/search.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 da2436d23b5d0b430474827a8d6d7a3ae07b7245..4324c150a76bd8928aa94f3b92b4f440785bb4fc 100644
--- a/pkg/analyzer/lib/src/dart/analysis/driver.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart
@@ -620,6 +620,23 @@ class AnalysisDriver implements AnalysisDriverGeneric {
}
/**
+ * Return the cached [AnalysisDriverResolvedUnit] for the file with the given
+ * [file], or `null` if the cache does not contain this information.
+ */
+ AnalysisDriverResolvedUnit getResolvedUnitObject(FileState file) {
+ FileState library = file.isPart ? file.library : file;
+ if (library != null) {
+ String signature = _getResolvedUnitSignature(library, file);
+ String key = _getResolvedUnitKey(signature);
+ List<int> bytes = _byteStore.get(key);
+ if (bytes != null) {
+ return new AnalysisDriverResolvedUnit.fromBuffer(bytes);
+ }
+ }
+ return null;
+ }
+
+ /**
* Return a [Future] that completes with a [AnalysisResult] 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`.
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/dart/analysis/search.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698