| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine; | 8 library engine; |
| 9 | 9 |
| 10 import "dart:math" as math; | 10 import "dart:math" as math; |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 */ | 387 */ |
| 388 set name(String name); | 388 set name(String name); |
| 389 | 389 |
| 390 /** | 390 /** |
| 391 * The stream that is notified when sources have been added or removed, | 391 * The stream that is notified when sources have been added or removed, |
| 392 * or the source's content has changed. | 392 * or the source's content has changed. |
| 393 */ | 393 */ |
| 394 Stream<SourcesChangedEvent> get onSourcesChanged; | 394 Stream<SourcesChangedEvent> get onSourcesChanged; |
| 395 | 395 |
| 396 /** | 396 /** |
| 397 * Return a list containing all of the sources known to this context whose | |
| 398 * state is neither valid or flushed. These sources are not safe to update | |
| 399 * during refactoring, because we might not know all the references in them. | |
| 400 */ | |
| 401 List<Source> get refactoringUnsafeSources; | |
| 402 | |
| 403 /** | |
| 404 * Return the source factory used to create the sources that can be analyzed | 397 * Return the source factory used to create the sources that can be analyzed |
| 405 * in this context. | 398 * in this context. |
| 406 */ | 399 */ |
| 407 SourceFactory get sourceFactory; | 400 SourceFactory get sourceFactory; |
| 408 | 401 |
| 409 /** | 402 /** |
| 410 * Set the source factory used to create the sources that can be analyzed in | 403 * Set the source factory used to create the sources that can be analyzed in |
| 411 * this context to the given source [factory]. Clients can safely assume that | 404 * this context to the given source [factory]. Clients can safely assume that |
| 412 * all analysis results have been invalidated. | 405 * all analysis results have been invalidated. |
| 413 */ | 406 */ |
| (...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1341 HashMap<Source, List<PendingFuture>> get pendingFutureSources_forTesting => | 1334 HashMap<Source, List<PendingFuture>> get pendingFutureSources_forTesting => |
| 1342 _pendingFutureSources; | 1335 _pendingFutureSources; |
| 1343 | 1336 |
| 1344 @override | 1337 @override |
| 1345 List<Source> get prioritySources => _priorityOrder; | 1338 List<Source> get prioritySources => _priorityOrder; |
| 1346 | 1339 |
| 1347 @override | 1340 @override |
| 1348 List<AnalysisTarget> get priorityTargets => prioritySources; | 1341 List<AnalysisTarget> get priorityTargets => prioritySources; |
| 1349 | 1342 |
| 1350 @override | 1343 @override |
| 1351 List<Source> get refactoringUnsafeSources { | |
| 1352 List<Source> sources = new List<Source>(); | |
| 1353 MapIterator<Source, SourceEntry> iterator = _cache.iterator(); | |
| 1354 while (iterator.moveNext()) { | |
| 1355 SourceEntry sourceEntry = iterator.value; | |
| 1356 if (sourceEntry is DartEntry) { | |
| 1357 Source source = iterator.key; | |
| 1358 if (!source.isInSystemLibrary && !sourceEntry.isRefactoringSafe) { | |
| 1359 sources.add(source); | |
| 1360 } | |
| 1361 } | |
| 1362 } | |
| 1363 return sources; | |
| 1364 } | |
| 1365 | |
| 1366 @override | |
| 1367 SourceFactory get sourceFactory => _sourceFactory; | 1344 SourceFactory get sourceFactory => _sourceFactory; |
| 1368 | 1345 |
| 1369 @override | 1346 @override |
| 1370 void set sourceFactory(SourceFactory factory) { | 1347 void set sourceFactory(SourceFactory factory) { |
| 1371 if (identical(_sourceFactory, factory)) { | 1348 if (identical(_sourceFactory, factory)) { |
| 1372 return; | 1349 return; |
| 1373 } else if (factory.context != null) { | 1350 } else if (factory.context != null) { |
| 1374 throw new IllegalStateException( | 1351 throw new IllegalStateException( |
| 1375 "Source factories cannot be shared between contexts"); | 1352 "Source factories cannot be shared between contexts"); |
| 1376 } | 1353 } |
| (...skipping 6156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7533 if (state.getState(BUILT_UNIT) == CacheState.VALID || | 7510 if (state.getState(BUILT_UNIT) == CacheState.VALID || |
| 7534 state.getState(RESOLVED_UNIT) == CacheState.VALID) { | 7511 state.getState(RESOLVED_UNIT) == CacheState.VALID) { |
| 7535 return true; | 7512 return true; |
| 7536 } | 7513 } |
| 7537 state = state._nextState; | 7514 state = state._nextState; |
| 7538 } | 7515 } |
| 7539 | 7516 |
| 7540 return false; | 7517 return false; |
| 7541 } | 7518 } |
| 7542 | 7519 |
| 7543 /** | |
| 7544 * Return `true` if this data is safe to use in refactoring. | |
| 7545 */ | |
| 7546 bool get isRefactoringSafe { | |
| 7547 ResolutionState state = _resolutionState; | |
| 7548 while (state != null) { | |
| 7549 CacheState resolvedState = state.getState(RESOLVED_UNIT); | |
| 7550 if (resolvedState != CacheState.VALID && | |
| 7551 resolvedState != CacheState.FLUSHED) { | |
| 7552 return false; | |
| 7553 } | |
| 7554 state = state._nextState; | |
| 7555 } | |
| 7556 return true; | |
| 7557 } | |
| 7558 | |
| 7559 @override | 7520 @override |
| 7560 SourceKind get kind => getValue(SOURCE_KIND); | 7521 SourceKind get kind => getValue(SOURCE_KIND); |
| 7561 | 7522 |
| 7562 /** | 7523 /** |
| 7563 * The library sources containing the receiver's source. | 7524 * The library sources containing the receiver's source. |
| 7564 */ | 7525 */ |
| 7565 List<Source> get librariesContaining { | 7526 List<Source> get librariesContaining { |
| 7566 ResolutionState state = _resolutionState; | 7527 ResolutionState state = _resolutionState; |
| 7567 List<Source> result = new List<Source>(); | 7528 List<Source> result = new List<Source>(); |
| 7568 while (state != null) { | 7529 while (state != null) { |
| (...skipping 4167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11736 visitElement(Element element) { | 11697 visitElement(Element element) { |
| 11737 if (element.id == _id) { | 11698 if (element.id == _id) { |
| 11738 result = element; | 11699 result = element; |
| 11739 throw new _ElementByIdFinderException(); | 11700 throw new _ElementByIdFinderException(); |
| 11740 } | 11701 } |
| 11741 super.visitElement(element); | 11702 super.visitElement(element); |
| 11742 } | 11703 } |
| 11743 } | 11704 } |
| 11744 | 11705 |
| 11745 class _ElementByIdFinderException {} | 11706 class _ElementByIdFinderException {} |
| OLD | NEW |