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

Side by Side Diff: pkg/analyzer/lib/src/context/context.dart

Issue 1399893004: Context invalidation on option changes (Implements #24574). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Review fix. 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 unified diff | Download patch
« no previous file with comments | « pkg/analysis_server/test/analysis/test_all.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.context.context; 5 library analyzer.src.context.context;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analyzer/instrumentation/instrumentation.dart'; 10 import 'package:analyzer/instrumentation/instrumentation.dart';
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 _sourceFactory.context = null; 408 _sourceFactory.context = null;
409 } 409 }
410 factory.context = this; 410 factory.context = this;
411 _sourceFactory = factory; 411 _sourceFactory = factory;
412 _cache = createCacheFromSourceFactory(factory); 412 _cache = createCacheFromSourceFactory(factory);
413 for (WorkManager workManager in workManagers) { 413 for (WorkManager workManager in workManagers) {
414 workManager.onSourceFactoryChanged(); 414 workManager.onSourceFactoryChanged();
415 } 415 }
416 } 416 }
417 417
418 /**
419 * Invalidate analysis cache.
420 */
421 void invalidateCachedResults() {
422 _cache = createCacheFromSourceFactory(_sourceFactory);
423 }
424
418 @override 425 @override
419 List<Source> get sources { 426 List<Source> get sources {
420 return _cache.sources.toList(); 427 return _cache.sources.toList();
421 } 428 }
422 429
423 /** 430 /**
424 * Return a list of the sources that would be processed by 431 * Return a list of the sources that would be processed by
425 * [performAnalysisTask]. This method duplicates, and must therefore be kept 432 * [performAnalysisTask]. This method duplicates, and must therefore be kept
426 * in sync with, [getNextAnalysisTask]. This method is intended to be used for 433 * in sync with, [getNextAnalysisTask]. This method is intended to be used for
427 * testing purposes only. 434 * testing purposes only.
(...skipping 1675 matching lines...) Expand 10 before | Expand all | Expand 10 after
2103 new PendingFuture<T>(_context, target, computeValue); 2110 new PendingFuture<T>(_context, target, computeValue);
2104 if (!pendingFuture.evaluate(entry)) { 2111 if (!pendingFuture.evaluate(entry)) {
2105 _context._pendingFutureTargets 2112 _context._pendingFutureTargets
2106 .putIfAbsent(target, () => <PendingFuture>[]) 2113 .putIfAbsent(target, () => <PendingFuture>[])
2107 .add(pendingFuture); 2114 .add(pendingFuture);
2108 scheduleComputation(); 2115 scheduleComputation();
2109 } 2116 }
2110 return pendingFuture.future; 2117 return pendingFuture.future;
2111 } 2118 }
2112 } 2119 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/analysis/test_all.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698