| Index: packages/analyzer/lib/src/task/html_work_manager.dart
|
| diff --git a/analyzer/lib/src/task/html_work_manager.dart b/packages/analyzer/lib/src/task/html_work_manager.dart
|
| similarity index 88%
|
| rename from analyzer/lib/src/task/html_work_manager.dart
|
| rename to packages/analyzer/lib/src/task/html_work_manager.dart
|
| index d438d51929f1534aa1719a5ec45b57f9d2d9a422..218b48ae27e80195fbb9c7fcfea781354751aa59 100644
|
| --- a/analyzer/lib/src/task/html_work_manager.dart
|
| +++ b/packages/analyzer/lib/src/task/html_work_manager.dart
|
| @@ -18,9 +18,7 @@ import 'package:analyzer/src/generated/engine.dart'
|
| import 'package:analyzer/src/generated/error.dart';
|
| import 'package:analyzer/src/generated/source.dart';
|
| import 'package:analyzer/src/generated/utilities_collection.dart';
|
| -import 'package:analyzer/src/task/driver.dart';
|
| import 'package:analyzer/src/task/html.dart';
|
| -import 'package:analyzer/task/general.dart';
|
| import 'package:analyzer/task/html.dart';
|
| import 'package:analyzer/task/model.dart';
|
|
|
| @@ -71,9 +69,7 @@ class HtmlWorkManager implements WorkManager {
|
| priorityResultQueue.add(new TargetedResult(target, result));
|
| }
|
|
|
| - /**
|
| - * Notifies the manager about changes in the explicit source list.
|
| - */
|
| + @override
|
| void applyChange(List<Source> addedSources, List<Source> changedSources,
|
| List<Source> removedSources) {
|
| addedSources = addedSources.where(_isHtmlSource).toList();
|
| @@ -103,26 +99,23 @@ class HtmlWorkManager implements WorkManager {
|
| }
|
| }
|
|
|
| - /**
|
| - * Return an [AnalysisErrorInfo] containing the list of all of the errors and
|
| - * the line info associated with the given [source]. The list of errors will
|
| - * be empty if the source is not known to the context or if there are no
|
| - * errors in the source. The errors contained in the list can be incomplete.
|
| - */
|
| - AnalysisErrorInfo getErrors(Source source) {
|
| + @override
|
| + List<AnalysisError> getErrors(Source source) {
|
| + if (!_isHtmlSource(source)) {
|
| + return AnalysisError.NO_ERRORS;
|
| + }
|
| + // If analysis is finished, use all the errors.
|
| if (analysisCache.getState(source, HTML_ERRORS) == CacheState.VALID) {
|
| - List<AnalysisError> errors = analysisCache.getValue(source, HTML_ERRORS);
|
| - LineInfo lineInfo = analysisCache.getValue(source, LINE_INFO);
|
| - return new AnalysisErrorInfoImpl(errors, lineInfo);
|
| + return analysisCache.getValue(source, HTML_ERRORS);
|
| }
|
| + // If analysis is in progress, combine all known partial results.
|
| List<AnalysisError> errors = <AnalysisError>[];
|
| errors.addAll(analysisCache.getValue(source, HTML_DOCUMENT_ERRORS));
|
| List<DartScript> scripts = analysisCache.getValue(source, DART_SCRIPTS);
|
| for (DartScript script in scripts) {
|
| errors.addAll(context.getErrors(script).errors);
|
| }
|
| - LineInfo lineInfo = analysisCache.getValue(source, LINE_INFO);
|
| - return new AnalysisErrorInfoImpl(errors, lineInfo);
|
| + return errors;
|
| }
|
|
|
| @override
|
| @@ -139,12 +132,10 @@ class HtmlWorkManager implements WorkManager {
|
| // Try to find a new HTML file to analyze.
|
| while (sourceQueue.isNotEmpty) {
|
| Source htmlSource = sourceQueue.first;
|
| - // Maybe done with this library.
|
| if (!_needsComputing(htmlSource, HTML_ERRORS)) {
|
| sourceQueue.remove(htmlSource);
|
| continue;
|
| }
|
| - // Analyze this library.
|
| return new TargetedResult(htmlSource, HTML_ERRORS);
|
| }
|
| // No results to compute.
|
| @@ -210,7 +201,7 @@ class HtmlWorkManager implements WorkManager {
|
| }
|
| });
|
| if (shouldSetErrors) {
|
| - AnalysisErrorInfo info = getErrors(target);
|
| + AnalysisErrorInfo info = context.getErrors(target);
|
| context.getNotice(target).setErrors(info.errors, info.lineInfo);
|
| }
|
| }
|
|
|