| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:collection'; | 6 import 'dart:collection'; |
| 7 | 7 |
| 8 import 'package:analyzer/dart/ast/ast.dart'; | 8 import 'package:analyzer/dart/ast/ast.dart'; |
| 9 import 'package:analyzer/error/error.dart'; | 9 import 'package:analyzer/error/error.dart'; |
| 10 import 'package:analyzer/file_system/file_system.dart'; | 10 import 'package:analyzer/file_system/file_system.dart'; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 * The byte storage to get and put serialized data. | 73 * The byte storage to get and put serialized data. |
| 74 * | 74 * |
| 75 * It can be shared with other [AnalysisDriver]s. | 75 * It can be shared with other [AnalysisDriver]s. |
| 76 */ | 76 */ |
| 77 final ByteStore _byteStore; | 77 final ByteStore _byteStore; |
| 78 | 78 |
| 79 /** | 79 /** |
| 80 * This [ContentCache] is consulted for a file content before reading | 80 * This [ContentCache] is consulted for a file content before reading |
| 81 * the content from the file. | 81 * the content from the file. |
| 82 */ | 82 */ |
| 83 final ContentCache _contentCache; | 83 final FileContentOverlay _contentOverlay; |
| 84 | 84 |
| 85 /** | 85 /** |
| 86 * The [SourceFactory] is used to resolve URIs to paths and restore URIs | 86 * The [SourceFactory] is used to resolve URIs to paths and restore URIs |
| 87 * from file paths. | 87 * from file paths. |
| 88 */ | 88 */ |
| 89 final SourceFactory _sourceFactory; | 89 final SourceFactory _sourceFactory; |
| 90 | 90 |
| 91 /** | 91 /** |
| 92 * The analysis options to analyze with. | 92 * The analysis options to analyze with. |
| 93 */ | 93 */ |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 */ | 151 */ |
| 152 AnalysisStatus _currentStatus = AnalysisStatus.IDLE; | 152 AnalysisStatus _currentStatus = AnalysisStatus.IDLE; |
| 153 | 153 |
| 154 /** | 154 /** |
| 155 * Create a new instance of [AnalysisDriver]. | 155 * Create a new instance of [AnalysisDriver]. |
| 156 * | 156 * |
| 157 * The given [SourceFactory] is cloned to ensure that it does not contain a | 157 * The given [SourceFactory] is cloned to ensure that it does not contain a |
| 158 * reference to a [AnalysisContext] in which it could have been used. | 158 * reference to a [AnalysisContext] in which it could have been used. |
| 159 */ | 159 */ |
| 160 AnalysisDriver(this._logger, this._resourceProvider, this._byteStore, | 160 AnalysisDriver(this._logger, this._resourceProvider, this._byteStore, |
| 161 this._contentCache, SourceFactory sourceFactory, this._analysisOptions) | 161 this._contentOverlay, SourceFactory sourceFactory, this._analysisOptions) |
| 162 : _sourceFactory = sourceFactory.clone() { | 162 : _sourceFactory = sourceFactory.clone() { |
| 163 _sdkBundle = sourceFactory.dartSdk.getLinkedBundle(); | 163 _sdkBundle = sourceFactory.dartSdk.getLinkedBundle(); |
| 164 _fsState = new FileSystemState(_logger, _byteStore, _contentCache, | 164 _fsState = new FileSystemState(_logger, _byteStore, _contentOverlay, |
| 165 _resourceProvider, _sourceFactory, _analysisOptions); | 165 _resourceProvider, _sourceFactory, _analysisOptions); |
| 166 } | 166 } |
| 167 | 167 |
| 168 /** | 168 /** |
| 169 * Set the list of files that the driver should try to analyze sooner. | 169 * Set the list of files that the driver should try to analyze sooner. |
| 170 * | 170 * |
| 171 * Every path in the list must be absolute and normalized. | 171 * Every path in the list must be absolute and normalized. |
| 172 * | 172 * |
| 173 * The driver will produce the results through the [results] stream. The | 173 * The driver will produce the results through the [results] stream. The |
| 174 * exact order in which results are produced is not defined, neither | 174 * exact order in which results are produced is not defined, neither |
| (...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 /** | 971 /** |
| 972 * Complete the [signal] future if it is not completed yet. It is safe to | 972 * Complete the [signal] future if it is not completed yet. It is safe to |
| 973 * call this method multiple times, but the [signal] will complete only once. | 973 * call this method multiple times, but the [signal] will complete only once. |
| 974 */ | 974 */ |
| 975 void notify() { | 975 void notify() { |
| 976 if (!_completer.isCompleted) { | 976 if (!_completer.isCompleted) { |
| 977 _completer.complete(null); | 977 _completer.complete(null); |
| 978 } | 978 } |
| 979 } | 979 } |
| 980 } | 980 } |
| OLD | NEW |