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

Unified Diff: pkg/analyzer_plugin/lib/utilities/assist/assist.dart

Issue 2956353002: Add a mixin for assists similar to that for fixes (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_plugin/lib/utilities/assist/assist.dart
diff --git a/pkg/analyzer_plugin/lib/utilities/assist/assist.dart b/pkg/analyzer_plugin/lib/utilities/assist/assist.dart
index 587235f5338484eff02211a50d9b6269f8ac7fb3..80dac24989b4bb0f40da54fbc35666a49bf41263 100644
--- a/pkg/analyzer_plugin/lib/utilities/assist/assist.dart
+++ b/pkg/analyzer_plugin/lib/utilities/assist/assist.dart
@@ -75,6 +75,42 @@ class AssistGenerator {
}
/**
+ * A description of a class of assists. Instances are intended to hold the
+ * information that is common across a number of assists and to be shared by
+ * those assists.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AssistKind {
+ /**
+ * The name of this kind of assist, used for debugging.
+ */
+ final String name;
+
+ /**
+ * The priority of this kind of assist for the kind of error being addressed.
+ */
+ final int priority;
+
+ /**
+ * A human-readable description of the changes that will be applied by this
+ * kind of assist. The message can contain parameters, where each parameter is
+ * represented by a zero-based index inside curly braces. For example, the
+ * message `"Create a component named '{0}' in '{1}'"` contains two parameters.
+ */
+ final String message;
+
+ /**
+ * Initialize a newly created kind of assist to have the given [name],
+ * [relevance] and [message].
+ */
+ const AssistKind(this.name, this.priority, this.message);
+
+ @override
+ String toString() => name;
+}
+
+/**
* The information about a requested set of assists.
*
* Clients may not extend, implement or mix-in this class.

Powered by Google App Engine
This is Rietveld 408576698