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

Unified Diff: pkg/analyzer/lib/src/task/html.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/driver.dart ('k') | pkg/analyzer/lib/src/task/manager.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/html.dart
diff --git a/pkg/analyzer/lib/src/task/html.dart b/pkg/analyzer/lib/src/task/html.dart
index b6a771a8651c8229efa0892d1b4580f53fceeeb5..01cdd5a5c45815131be6cf52cbe67d0d06e36033 100644
--- a/pkg/analyzer/lib/src/task/html.dart
+++ b/pkg/analyzer/lib/src/task/html.dart
@@ -279,7 +279,8 @@ class ParseHtmlTask extends SourceBasedAnalysisTask {
'ParseHtmlTask',
createTask,
buildInputs,
- <ResultDescriptor>[HTML_DOCUMENT, HTML_DOCUMENT_ERRORS, LINE_INFO]);
+ <ResultDescriptor>[HTML_DOCUMENT, HTML_DOCUMENT_ERRORS, LINE_INFO],
+ suitabilityFor: suitabilityFor);
/**
* Initialize a newly created task to access the content of the source
@@ -358,6 +359,20 @@ class ParseHtmlTask extends SourceBasedAnalysisTask {
}
/**
+ * Return an indication of how suitable this task is for the given [target].
+ */
+ static TaskSuitability suitabilityFor(AnalysisTarget target) {
+ if (target is Source) {
+ String name = target.shortName;
+ if (name.endsWith(AnalysisEngine.SUFFIX_HTML) ||
+ name.endsWith(AnalysisEngine.SUFFIX_HTM)) {
+ return TaskSuitability.HIGHEST;
+ }
+ }
+ return TaskSuitability.NONE;
+ }
+
+ /**
* Compute [LineInfo] for the given [content].
*/
static LineInfo _computeLineInfo(String content) {
« no previous file with comments | « pkg/analyzer/lib/src/task/driver.dart ('k') | pkg/analyzer/lib/src/task/manager.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698