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

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

Issue 1215723004: Remove last failing test and minor clean-up (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 | « no previous file | pkg/analyzer/test/src/context/context_test.dart » ('j') | 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 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after
1385 * [newLength] information is used by the context to determine what reanalysis 1385 * [newLength] information is used by the context to determine what reanalysis
1386 * is necessary. The method [setChangedContents] triggers a source changed 1386 * is necessary. The method [setChangedContents] triggers a source changed
1387 * event where as this method does not. 1387 * event where as this method does not.
1388 */ 1388 */
1389 bool _contentRangeChanged(Source source, String contents, int offset, 1389 bool _contentRangeChanged(Source source, String contents, int offset,
1390 int oldLength, int newLength) { 1390 int oldLength, int newLength) {
1391 bool changed = false; 1391 bool changed = false;
1392 String originalContents = _contentCache.setContents(source, contents); 1392 String originalContents = _contentCache.setContents(source, contents);
1393 if (contents != null) { 1393 if (contents != null) {
1394 if (contents != originalContents) { 1394 if (contents != originalContents) {
1395 // TODO(brianwilkerson) Find a better way to do incremental analysis.
1396 // if (_options.incremental) {
1397 // _incrementalAnalysisCache = IncrementalAnalysisCache.update(
1398 // _incrementalAnalysisCache, source, originalContents, contents,
1399 // offset, oldLength, newLength, _cache.get(source));
1400 // }
1401 _sourceChanged(source); 1395 _sourceChanged(source);
1402 changed = true; 1396 changed = true;
1403 CacheEntry entry = _cache.get(source); 1397 CacheEntry entry = _cache.get(source);
1404 if (entry != null) { 1398 if (entry != null) {
1405 entry.modificationTime = _contentCache.getModificationStamp(source); 1399 entry.modificationTime = _contentCache.getModificationStamp(source);
1406 entry.setValue(CONTENT, contents, TargetedResult.EMPTY_LIST); 1400 entry.setValue(CONTENT, contents, TargetedResult.EMPTY_LIST);
1407 } 1401 }
1408 } 1402 }
1409 } else if (originalContents != null) { 1403 } else if (originalContents != null) {
1410 _sourceChanged(source); 1404 _sourceChanged(source);
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
2033 new PendingFuture<T>(_context, target, computeValue); 2027 new PendingFuture<T>(_context, target, computeValue);
2034 if (!pendingFuture.evaluate(entry)) { 2028 if (!pendingFuture.evaluate(entry)) {
2035 _context._pendingFutureTargets 2029 _context._pendingFutureTargets
2036 .putIfAbsent(target, () => <PendingFuture>[]) 2030 .putIfAbsent(target, () => <PendingFuture>[])
2037 .add(pendingFuture); 2031 .add(pendingFuture);
2038 scheduleComputation(); 2032 scheduleComputation();
2039 } 2033 }
2040 return pendingFuture.future; 2034 return pendingFuture.future;
2041 } 2035 }
2042 } 2036 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/context/context_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698