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

Side by Side Diff: pkg/analysis_server/lib/edit/fix/fix_core.dart

Issue 1084793006: Add file missed in previous CL and comment clean-up (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 library analysis_server.edit.fix.fix_core; 5 library analysis_server.edit.fix.fix_core;
6 6
7 import 'package:analysis_server/src/protocol.dart' show SourceChange; 7 import 'package:analysis_server/src/protocol.dart' show SourceChange;
8 import 'package:analyzer/src/generated/engine.dart'; 8 import 'package:analyzer/src/generated/engine.dart';
9 import 'package:analyzer/src/generated/error.dart'; 9 import 'package:analyzer/src/generated/error.dart';
10 10
11 /** 11 /**
12 * A description of a single proposed fix for some problem. 12 * A description of a single proposed fix for some problem.
13 *
14 * Clients are not expected to subtype this class.
13 */ 15 */
14 class Fix { 16 class Fix {
15 /** 17 /**
16 * An empty list of fixes. 18 * An empty list of fixes.
17 */ 19 */
18 static const List<Fix> EMPTY_LIST = const <Fix>[]; 20 static const List<Fix> EMPTY_LIST = const <Fix>[];
19 21
20 /** 22 /**
21 * A comparator that can be used to sort fixes by their relevance. The most 23 * A comparator that can be used to sort fixes by their relevance. The most
22 * relevant fixes will be sorted before fixes with a lower relevance. 24 * relevant fixes will be sorted before fixes with a lower relevance.
(...skipping 19 matching lines...) Expand all
42 @override 44 @override
43 String toString() { 45 String toString() {
44 return 'Fix(kind=$kind, change=$change)'; 46 return 'Fix(kind=$kind, change=$change)';
45 } 47 }
46 } 48 }
47 49
48 /** 50 /**
49 * An object used to produce fixes for a specific error. Fix contributors are 51 * An object used to produce fixes for a specific error. Fix contributors are
50 * long-lived objects and must not retain any state between invocations of 52 * long-lived objects and must not retain any state between invocations of
51 * [computeFixes]. 53 * [computeFixes].
54 *
55 * Clients are expected to subtype this class when implementing plugins.
52 */ 56 */
53 abstract class FixContributor { 57 abstract class FixContributor {
54 /** 58 /**
55 * Return a list of fixes for the given [error]. The error was reported 59 * Return a list of fixes for the given [error]. The error was reported
56 * after it's source was analyzed in the given [context]. 60 * after it's source was analyzed in the given [context].
57 */ 61 */
58 List<Fix> computeFixes(AnalysisContext context, AnalysisError error); 62 List<Fix> computeFixes(AnalysisContext context, AnalysisError error);
59 } 63 }
60 64
61 /** 65 /**
62 * A description of a class of fixes. Instances are intended to hold the 66 * A description of a class of fixes. Instances are intended to hold the
63 * information that is common across a number of fixes and to be shared by those 67 * information that is common across a number of fixes and to be shared by those
64 * fixes. For example, if an unnecessary cast is found then one of the suggested 68 * fixes. For example, if an unnecessary cast is found then one of the suggested
65 * fixes will be to remove the cast. If there are multiple unnecessary casts in 69 * fixes will be to remove the cast. If there are multiple unnecessary casts in
66 * a single file, then there will be multiple fixes, one per occurance, but they 70 * a single file, then there will be multiple fixes, one per occurance, but they
67 * will all share the same kind. 71 * will all share the same kind.
72 *
73 * Clients are not expected to subtype this class.
68 */ 74 */
69 class FixKind { 75 class FixKind {
70 /** 76 /**
71 * The name of this kind of fix, used for debugging. 77 * The name of this kind of fix, used for debugging.
72 */ 78 */
73 final String name; 79 final String name;
74 80
75 /** 81 /**
76 * The relevance of this kind of fix for the kind of error being addressed. 82 * The relevance of this kind of fix for the kind of error being addressed.
77 */ 83 */
78 final int relevance; 84 final int relevance;
79 85
80 /** 86 /**
81 * A human-readable description of the changes that will be applied by this 87 * A human-readable description of the changes that will be applied by this
82 * kind of fix. 88 * kind of fix.
83 */ 89 */
84 final String message; 90 final String message;
85 91
86 /** 92 /**
87 * Initialize a newly created kind of fix to have the given [name], 93 * Initialize a newly created kind of fix to have the given [name],
88 * [relevance] and [message]. 94 * [relevance] and [message].
89 */ 95 */
90 const FixKind(this.name, this.relevance, this.message); 96 const FixKind(this.name, this.relevance, this.message);
91 97
92 @override 98 @override
93 String toString() => name; 99 String toString() => name;
94 } 100 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/edit/assist/assist_dart.dart ('k') | pkg/analysis_server/lib/edit/fix/fix_dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698