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

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

Issue 562183003: Issue 10355. Quick Fix to replace 'var' with 'dynamic'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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_internal.dart
diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
index 1cb09d539e7bcd222c1fc5573109c398d67c2802..b840607e56a348754a7a99acb89ff680bca2851f 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -135,6 +135,9 @@ class FixProcessor {
if (errorCode == ParserErrorCode.GETTER_WITH_PARAMETERS) {
_addFix_removeParameters_inGetterDeclaration();
}
+ if (errorCode == ParserErrorCode.VAR_AS_TYPE_NAME) {
+ _addFix_replaceVarWithDynamic();
+ }
if (errorCode == StaticWarningCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER) {
_addFix_makeEnclosingClassAbstract();
}
@@ -954,6 +957,12 @@ class FixProcessor {
_addFix(FixKind.REMOVE_UNUSED_IMPORT, []);
}
+ void _addFix_replaceVarWithDynamic() {
+ SourceRange range = rf.rangeError(error);
+ _addReplaceEdit(range, "dynamic");
+ _addFix(FixKind.REPLACE_VAR_WITH_DYNAMIC, []);
+ }
+
void _addFix_replaceWithConstInstanceCreation() {
if (coveredNode is InstanceCreationExpression) {
var instanceCreation = coveredNode as InstanceCreationExpression;
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/fix.dart ('k') | pkg/analysis_server/test/services/correction/fix_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698