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

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

Issue 1753083003: Fix issue where errors aren't reported for a new overlay (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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/context/context.dart
diff --git a/pkg/analyzer/lib/src/context/context.dart b/pkg/analyzer/lib/src/context/context.dart
index 394f30103715469a2c3bdbe5e45806739b53c2cd..7a608a8480722befa74275e4c0167318a597967a 100644
--- a/pkg/analyzer/lib/src/context/context.dart
+++ b/pkg/analyzer/lib/src/context/context.dart
@@ -1011,10 +1011,21 @@ class AnalysisContextImpl implements InternalAnalysisContext {
@override
bool handleContentsChanged(
- Source source, String originalContents, String newContents, bool notify) {
+ Source source, String originalContents, String newContents, bool notify,
+ {bool explicit: false}) {
+ explicit = explicit && (newContents != null);
CacheEntry entry = _cache.get(source);
if (entry == null) {
- return false;
+ if (explicit) {
+ // Create it now.
+ entry = _createCacheEntry(source, true);
+ } else {
+ return false;
+ }
+ }
+ if (explicit) {
+ // Mark as explicit whether there was any other change or not.
+ entry.explicitlyAdded = true;
}
bool changed = newContents != originalContents;
if (newContents != null) {
@@ -1744,9 +1755,9 @@ class AnalysisContextImpl implements InternalAnalysisContext {
void _sourceAvailable(Source source) {
driver.reset();
// TODO(brianwilkerson) This method needs to check whether the source was
- // previously being implicitly analyzed. If so, the cache entry needs to be
- // update to reflect the new status and an event needs to be generated to
- // inform clients that it is no longer being implicitly analyzed.
+ // previously being implicitly analyzed. If so, an event needs to be
+ // generated to inform clients that it is no longer being implicitly
+ // analyzed.
CacheEntry entry = _cache.get(source);
if (entry == null) {
_createCacheEntry(source, true);

Powered by Google App Engine
This is Rietveld 408576698