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

Unified Diff: pkg/analysis_server/lib/src/services/correction/fix.dart

Issue 2397153004: Issue 27536. Quick Fix for 'Avoid using braces in interpolation when not needed'. (Closed)
Patch Set: Created 4 years, 2 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/src/services/correction/fix.dart
diff --git a/pkg/analysis_server/lib/src/services/correction/fix.dart b/pkg/analysis_server/lib/src/services/correction/fix.dart
index a0b6d10ce7dc16106f494714235c126b06fb9302..0d49cf4d3d865416ef7e40d9e1caa4e7aa8f55a1 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix.dart
@@ -105,7 +105,9 @@ bool hasFix(ErrorCode errorCode) =>
errorCode == StaticTypeWarningCode.UNDEFINED_GETTER ||
errorCode == StaticTypeWarningCode.UNDEFINED_METHOD ||
errorCode == StaticTypeWarningCode.UNDEFINED_SETTER ||
- (errorCode is LintCode && errorCode.name == LintNames.annotate_overrides);
+ (errorCode is LintCode &&
+ (errorCode.name == LintNames.annotate_overrides ||
+ errorCode.name == LintNames.unnecessary_brace_in_string_interp));
/**
* An enumeration of possible quick fix kinds.
@@ -179,6 +181,10 @@ class DartFixKind {
const FixKind('INSERT_SEMICOLON', 50, "Insert ';'");
static const LINT_ADD_OVERRIDE =
const FixKind('LINT_ADD_OVERRIDE', 50, "Add '@override' annotation");
+ static const LINT_REMOVE_INTERPOLATION_BRACES = const FixKind(
+ 'LINT_REMOVE_INTERPOLATION_BRACES',
+ 50,
+ 'Remove unnecessary interpolation braces');
static const MAKE_CLASS_ABSTRACT =
const FixKind('MAKE_CLASS_ABSTRACT', 50, "Make class '{0}' abstract");
static const REMOVE_DEAD_CODE =

Powered by Google App Engine
This is Rietveld 408576698