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

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

Issue 2610063004: Add ContentCache.getExists() and use it in AnalysisContextImpl.exists(). (Closed)
Patch Set: Created 3 years, 11 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/generated/source.dart
diff --git a/pkg/analyzer/lib/src/generated/source.dart b/pkg/analyzer/lib/src/generated/source.dart
index e4ceae7d5e77be2734924ba666dab8535b1581e9..1696bb926c3ce2a4e63c8796dd585a9f0dd770bf 100644
--- a/pkg/analyzer/lib/src/generated/source.dart
+++ b/pkg/analyzer/lib/src/generated/source.dart
@@ -66,6 +66,17 @@ class ContentCache {
String getContents(Source source) => _contentMap[source.fullName];
/**
+ * Return `true` if the given [source] exists, `false` if it does not exist,
+ * or `null` if this cache does not override existence of the source.
Paul Berry 2017/01/04 18:28:57 It looks like you are trying to plan ahead to a po
scheglov 2017/01/04 20:07:27 I'm trying to extend ContentCache to fully control
+ *
+ * <b>Note:</b> This method is not intended to be used except by
+ * [AnalysisContext.exists].
+ */
+ bool getExists(Source source) {
+ return _contentMap.containsKey(source.fullName) ? true : null;
Brian Wilkerson 2017/01/04 18:05:10 Did you intend to return `null` rather than `false
+ }
+
+ /**
* Return the modification stamp of the given [source], or `null` if this
* cache does not override the contents of the source.
*
« pkg/analyzer/lib/src/context/context.dart ('K') | « pkg/analyzer/lib/src/context/context.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698