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

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

Issue 2962903002: Add support code to make fixes easier in plugins (Closed)
Patch Set: Created 3 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'package:analysis_server/plugin/edit/fix/fix_core.dart'; 5 import 'package:analysis_server/plugin/edit/fix/fix_core.dart';
6 import 'package:analysis_server/src/services/correction/fix_internal.dart'; 6 import 'package:analysis_server/src/services/correction/fix_internal.dart';
7 import 'package:analyzer/error/error.dart'; 7 import 'package:analyzer/error/error.dart';
8 import 'package:analyzer/file_system/file_system.dart'; 8 import 'package:analyzer/file_system/file_system.dart';
9 import 'package:analyzer/src/dart/analysis/driver.dart'; 9 import 'package:analyzer/src/dart/analysis/driver.dart';
10 import 'package:analyzer/src/error/codes.dart'; 10 import 'package:analyzer/src/error/codes.dart';
11 import 'package:analyzer/src/generated/parser.dart'; 11 import 'package:analyzer/src/generated/parser.dart';
12 import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
12 13
13 /** 14 /**
14 * Return true if this [errorCode] is likely to have a fix associated with it. 15 * Return true if this [errorCode] is likely to have a fix associated with it.
15 */ 16 */
16 bool hasFix(ErrorCode errorCode) => 17 bool hasFix(ErrorCode errorCode) =>
17 errorCode == StaticWarningCode.UNDEFINED_CLASS_BOOLEAN || 18 errorCode == StaticWarningCode.UNDEFINED_CLASS_BOOLEAN ||
18 errorCode == StaticWarningCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER || 19 errorCode == StaticWarningCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER ||
19 errorCode == StaticWarningCode.EXTRA_POSITIONAL_ARGUMENTS || 20 errorCode == StaticWarningCode.EXTRA_POSITIONAL_ARGUMENTS ||
20 errorCode == StaticWarningCode.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED || 21 errorCode == StaticWarningCode.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED ||
21 errorCode == StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR || 22 errorCode == StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR ||
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 @override 239 @override
239 final AnalysisError error; 240 final AnalysisError error;
240 241
241 FixContextImpl(this.resourceProvider, this.analysisDriver, this.error); 242 FixContextImpl(this.resourceProvider, this.analysisDriver, this.error);
242 243
243 FixContextImpl.from(FixContext other) 244 FixContextImpl.from(FixContext other)
244 : resourceProvider = other.resourceProvider, 245 : resourceProvider = other.resourceProvider,
245 analysisDriver = other.analysisDriver, 246 analysisDriver = other.analysisDriver,
246 error = other.error; 247 error = other.error;
247 } 248 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698