| OLD | NEW |
| 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/src/cancelable_future.dart'; | 10 import 'package:analyzer/src/cancelable_future.dart'; |
| (...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1164 int oldLength, int newLength) { | 1164 int oldLength, int newLength) { |
| 1165 if (_contentRangeChanged(source, contents, offset, oldLength, newLength)) { | 1165 if (_contentRangeChanged(source, contents, offset, oldLength, newLength)) { |
| 1166 _onSourcesChangedController.add(new SourcesChangedEvent.changedRange( | 1166 _onSourcesChangedController.add(new SourcesChangedEvent.changedRange( |
| 1167 source, contents, offset, oldLength, newLength)); | 1167 source, contents, offset, oldLength, newLength)); |
| 1168 } | 1168 } |
| 1169 } | 1169 } |
| 1170 | 1170 |
| 1171 @override | 1171 @override |
| 1172 void setContents(Source source, String contents) { | 1172 void setContents(Source source, String contents) { |
| 1173 _contentsChanged(source, contents, true); | 1173 _contentsChanged(source, contents, true); |
| 1174 dartWorkManager.applyChange( | |
| 1175 Source.EMPTY_LIST, <Source>[source], Source.EMPTY_LIST); | |
| 1176 } | 1174 } |
| 1177 | 1175 |
| 1178 @override | 1176 @override |
| 1179 void visitCacheItems(void callback(Source source, SourceEntry dartEntry, | 1177 void visitCacheItems(void callback(Source source, SourceEntry dartEntry, |
| 1180 DataDescriptor rowDesc, CacheState state)) { | 1178 DataDescriptor rowDesc, CacheState state)) { |
| 1181 // TODO(brianwilkerson) Figure out where this is used and adjust the call | 1179 // TODO(brianwilkerson) Figure out where this is used and adjust the call |
| 1182 // sites to use CacheEntry's. | 1180 // sites to use CacheEntry's. |
| 1183 // bool hintsEnabled = _options.hint; | 1181 // bool hintsEnabled = _options.hint; |
| 1184 // bool lintsEnabled = _options.lint; | 1182 // bool lintsEnabled = _options.lint; |
| 1185 // MapIterator<AnalysisTarget, cache.CacheEntry> iterator = _cache.iterator()
; | 1183 // MapIterator<AnalysisTarget, cache.CacheEntry> iterator = _cache.iterator()
; |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1686 int time = fileContents.modificationTime; | 1684 int time = fileContents.modificationTime; |
| 1687 for (CacheEntry entry in _entriesFor(source)) { | 1685 for (CacheEntry entry in _entriesFor(source)) { |
| 1688 entry.modificationTime = time; | 1686 entry.modificationTime = time; |
| 1689 } | 1687 } |
| 1690 return; | 1688 return; |
| 1691 } | 1689 } |
| 1692 } catch (e) {} | 1690 } catch (e) {} |
| 1693 } | 1691 } |
| 1694 // We need to invalidate the cache. | 1692 // We need to invalidate the cache. |
| 1695 entry.setState(CONTENT, CacheState.INVALID); | 1693 entry.setState(CONTENT, CacheState.INVALID); |
| 1694 dartWorkManager.applyChange( |
| 1695 Source.EMPTY_LIST, <Source>[source], Source.EMPTY_LIST); |
| 1696 } | 1696 } |
| 1697 | 1697 |
| 1698 /** | 1698 /** |
| 1699 * Record that the give [source] has been deleted. | 1699 * Record that the give [source] has been deleted. |
| 1700 */ | 1700 */ |
| 1701 void _sourceDeleted(Source source) { | 1701 void _sourceDeleted(Source source) { |
| 1702 // TODO(brianwilkerson) Implement this. | 1702 // TODO(brianwilkerson) Implement this. |
| 1703 // SourceEntry sourceEntry = _cache.get(source); | 1703 // SourceEntry sourceEntry = _cache.get(source); |
| 1704 // if (sourceEntry is HtmlEntry) { | 1704 // if (sourceEntry is HtmlEntry) { |
| 1705 // HtmlEntry htmlEntry = sourceEntry; | 1705 // HtmlEntry htmlEntry = sourceEntry; |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2038 PendingFuture pendingFuture = | 2038 PendingFuture pendingFuture = |
| 2039 new PendingFuture<T>(_context, target, computeValue); | 2039 new PendingFuture<T>(_context, target, computeValue); |
| 2040 if (!pendingFuture.evaluate(entry)) { | 2040 if (!pendingFuture.evaluate(entry)) { |
| 2041 _context._pendingFutureTargets | 2041 _context._pendingFutureTargets |
| 2042 .putIfAbsent(target, () => <PendingFuture>[]) | 2042 .putIfAbsent(target, () => <PendingFuture>[]) |
| 2043 .add(pendingFuture); | 2043 .add(pendingFuture); |
| 2044 } | 2044 } |
| 2045 return pendingFuture.future; | 2045 return pendingFuture.future; |
| 2046 } | 2046 } |
| 2047 } | 2047 } |
| OLD | NEW |