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

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

Issue 1645643002: Replace isAppropriateFor with suitabilityFor and start using it (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « pkg/analyzer/lib/src/task/model.dart ('k') | pkg/analyzer/lib/src/task/yaml.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6775408ba659b07e5ccbc77818d29682727c5271..4a6483cf321f8817753864b1bab689afd22d8e1f 100644
--- a/pkg/analyzer/lib/src/task/options.dart
+++ b/pkg/analyzer/lib/src/task/options.dart
@@ -202,7 +202,8 @@ class GenerateOptionsErrorsTask extends SourceBasedAnalysisTask {
'GenerateOptionsErrorsTask',
createTask,
buildInputs,
- <ResultDescriptor>[ANALYSIS_OPTIONS_ERRORS, LINE_INFO]);
+ <ResultDescriptor>[ANALYSIS_OPTIONS_ERRORS, LINE_INFO],
+ suitabilityFor: suitabilityFor);
final AnalysisOptionsProvider optionsProvider = new AnalysisOptionsProvider();
@@ -257,6 +258,17 @@ class GenerateOptionsErrorsTask extends SourceBasedAnalysisTask {
static GenerateOptionsErrorsTask createTask(
AnalysisContext context, AnalysisTarget target) =>
new GenerateOptionsErrorsTask(context, target);
+
+ /**
+ * Return an indication of how suitable this task is for the given [target].
+ */
+ static TaskSuitability suitabilityFor(AnalysisTarget target) {
+ if (target is Source &&
+ target.shortName == AnalysisEngine.ANALYSIS_OPTIONS_FILE) {
+ return TaskSuitability.HIGHEST;
+ }
+ return TaskSuitability.NONE;
+ }
}
/// Validates `analyzer` language configuration options.
« no previous file with comments | « pkg/analyzer/lib/src/task/model.dart ('k') | pkg/analyzer/lib/src/task/yaml.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698