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

Unified Diff: pkg/analysis_server/lib/plugin/edit/assist/assist_core.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/analysis_server/lib/plugin/edit/assist/assist_core.dart
diff --git a/pkg/analysis_server/lib/plugin/edit/assist/assist_core.dart b/pkg/analysis_server/lib/plugin/edit/assist/assist_core.dart
index a286255495488e599402e46ecd4d2e73e14398bd..f4d1e6254e5e1c5c9e7b91b4992d1c952a48206c 100644
--- a/pkg/analysis_server/lib/plugin/edit/assist/assist_core.dart
+++ b/pkg/analysis_server/lib/plugin/edit/assist/assist_core.dart
@@ -8,6 +8,7 @@ import 'package:analyzer/src/dart/analysis/driver.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer_plugin/protocol/protocol_common.dart'
show SourceChange;
+import 'package:analyzer_plugin/utilities/assist/assist.dart';
/**
* A description of a single proposed assist.
@@ -26,7 +27,7 @@ class Assist {
*/
static final Comparator<Assist> SORT_BY_RELEVANCE =
(Assist firstAssist, Assist secondAssist) =>
- firstAssist.kind.relevance - secondAssist.kind.relevance;
+ firstAssist.kind.priority - secondAssist.kind.priority;
/**
* A description of the assist being proposed.
@@ -87,37 +88,3 @@ abstract class AssistContributor {
*/
Future<List<Assist>> computeAssists(AssistContext context);
}
-
-/**
- * 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 relevance of this kind of assist for the kind of error being addressed.
- */
- final int relevance;
-
- /**
- * A human-readable description of the changes that will be applied by this
- * kind of assist.
- */
- final String message;
-
- /**
- * Initialize a newly created kind of assist to have the given [name],
- * [relevance] and [message].
- */
- const AssistKind(this.name, this.relevance, this.message);
-
- @override
- String toString() => name;
-}

Powered by Google App Engine
This is Rietveld 408576698