Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1335)

Unified Diff: pkg/analyzer/lib/src/task/options.dart

Issue 2946313003: Restore partial analysis of analysis options files (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/src/task/options.dart
diff --git a/pkg/analyzer/lib/src/task/options.dart b/pkg/analyzer/lib/src/task/options.dart
index 050d3bce27f8843cf8cde03cf5f6bde82a5fa1f5..c761f7680bfe7c4ce9771b4fb084ca9be27293fd 100644
--- a/pkg/analyzer/lib/src/task/options.dart
+++ b/pkg/analyzer/lib/src/task/options.dart
@@ -233,10 +233,21 @@ class GenerateOptionsErrorsTask extends SourceBasedAnalysisTask {
@override
void internalPerform() {
String content = getRequiredInput(CONTENT_INPUT_NAME);
+ //
+ // Record outputs.
+ //
+ outputs[ANALYSIS_OPTIONS_ERRORS] =
+ analyzeAnalysisOptions(source, content, context?.sourceFactory);
+ outputs[LINE_INFO] = computeLineInfo(content);
+ }
+ static List<AnalysisError> analyzeAnalysisOptions(
+ Source source, String content, SourceFactory sourceFactory) {
List<AnalysisError> errors = <AnalysisError>[];
Source initialSource = source;
SourceSpan initialIncludeSpan;
+ AnalysisOptionsProvider optionsProvider =
+ new AnalysisOptionsProvider(sourceFactory);
// Validate the specified options and any included option files
void validate(Source source, Map<String, YamlNode> options) {
@@ -268,8 +279,7 @@ class GenerateOptionsErrorsTask extends SourceBasedAnalysisTask {
SourceSpan span = node.span;
initialIncludeSpan ??= span;
String includeUri = span.text;
- Source includedSource =
- context.sourceFactory.resolveUri(source, includeUri);
+ Source includedSource = sourceFactory.resolveUri(source, includeUri);
if (!includedSource.exists()) {
errors.add(new AnalysisError(
initialSource,
@@ -310,12 +320,7 @@ class GenerateOptionsErrorsTask extends SourceBasedAnalysisTask {
errors.add(new AnalysisError(source, span.start.column + 1, span.length,
AnalysisOptionsErrorCode.PARSE_ERROR, [e.message]));
}
-
- //
- // Record outputs.
- //
- outputs[ANALYSIS_OPTIONS_ERRORS] = errors;
- outputs[LINE_INFO] = computeLineInfo(content);
+ return errors;
}
/// Return a map from the names of the inputs of this kind of task to the

Powered by Google App Engine
This is Rietveld 408576698