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.task.options_work_manager; | 5 library analyzer.src.task.options_work_manager; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analyzer/src/context/cache.dart'; | 9 import 'package:analyzer/src/context/cache.dart'; |
10 import 'package:analyzer/src/generated/engine.dart' | 10 import 'package:analyzer/src/generated/engine.dart'; |
11 show | |
12 AnalysisEngine, | |
13 AnalysisErrorInfo, | |
14 AnalysisErrorInfoImpl, | |
15 AnalysisOptions, | |
16 CacheState, | |
17 InternalAnalysisContext; | |
18 import 'package:analyzer/src/generated/error.dart'; | 11 import 'package:analyzer/src/generated/error.dart'; |
19 import 'package:analyzer/src/generated/source.dart'; | 12 import 'package:analyzer/src/generated/source.dart'; |
20 import 'package:analyzer/src/task/options.dart'; | 13 import 'package:analyzer/src/task/options.dart'; |
21 import 'package:analyzer/task/model.dart'; | 14 import 'package:analyzer/task/model.dart'; |
22 | 15 |
23 /// The manager for `.analysis_options` specific analysis. | 16 /// The manager for `.analysis_options` specific analysis. |
24 class OptionsWorkManager implements WorkManager { | 17 class OptionsWorkManager implements WorkManager { |
25 /// The context for which work is being managed. | 18 /// The context for which work is being managed. |
26 final InternalAnalysisContext context; | 19 final InternalAnalysisContext context; |
27 | 20 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 } | 155 } |
163 | 156 |
164 /// Returns `true` if the given [result] of the given [target] needs | 157 /// Returns `true` if the given [result] of the given [target] needs |
165 /// computing, i.e. it is not in the valid and not in the error state. | 158 /// computing, i.e. it is not in the valid and not in the error state. |
166 bool _needsComputing(AnalysisTarget target, ResultDescriptor result) { | 159 bool _needsComputing(AnalysisTarget target, ResultDescriptor result) { |
167 CacheState state = analysisCache.getState(target, result); | 160 CacheState state = analysisCache.getState(target, result); |
168 return state != CacheState.VALID && state != CacheState.ERROR; | 161 return state != CacheState.VALID && state != CacheState.ERROR; |
169 } | 162 } |
170 | 163 |
171 /// Return `true` if the given target is an `.analysis_options` source. | 164 /// Return `true` if the given target is an `.analysis_options` source. |
172 static bool _isOptionsSource(AnalysisTarget target) => target is Source && | 165 static bool _isOptionsSource(AnalysisTarget target) => |
| 166 target is Source && |
173 AnalysisEngine.isAnalysisOptionsFileName(target.fullName); | 167 AnalysisEngine.isAnalysisOptionsFileName(target.fullName); |
174 } | 168 } |
OLD | NEW |