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