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

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

Issue 1253103007: WEB-17598. Name new libraries according to the Dart Style Guide. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « no previous file | pkg/analysis_server/lib/edit/fix/fix_dart.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/file_system/file_system.dart';
8 import 'package:analyzer/src/generated/engine.dart'; 9 import 'package:analyzer/src/generated/engine.dart';
9 import 'package:analyzer/src/generated/error.dart'; 10 import 'package:analyzer/src/generated/error.dart';
10 11
11 /** 12 /**
12 * A description of a single proposed fix for some problem. 13 * A description of a single proposed fix for some problem.
13 * 14 *
14 * Clients are not expected to subtype this class. 15 * Clients are not expected to subtype this class.
15 */ 16 */
16 class Fix { 17 class Fix {
17 /** 18 /**
18 * An empty list of fixes. 19 * An empty list of fixes.
19 */ 20 */
20 static const List<Fix> EMPTY_LIST = const <Fix>[]; 21 static const List<Fix> EMPTY_LIST = const <Fix>[];
21 22
22 /** 23 /**
23 * A comparator that can be used to sort fixes by their relevance. The most 24 * A comparator that can be used to sort fixes by their relevance. The most
24 * relevant fixes will be sorted before fixes with a lower relevance. 25 * relevant fixes will be sorted before fixes with a lower relevance.
25 */ 26 */
26 static final Comparator<Fix> SORT_BY_RELEVANCE = (Fix firstFix, 27 static final Comparator<Fix> SORT_BY_RELEVANCE = (Fix firstFix,
27 Fix secondFix) => firstFix.kind.relevance - secondFix.kind.relevance; 28 Fix secondFix) =>
29 firstFix.kind.relevance - secondFix.kind.relevance;
28 30
29 /** 31 /**
30 * A description of the fix being proposed. 32 * A description of the fix being proposed.
31 */ 33 */
32 final FixKind kind; 34 final FixKind kind;
33 35
34 /** 36 /**
35 * The change to be made in order to apply the fix. 37 * The change to be made in order to apply the fix.
36 */ 38 */
37 final SourceChange change; 39 final SourceChange change;
(...skipping 14 matching lines...) Expand all
52 * long-lived objects and must not retain any state between invocations of 54 * long-lived objects and must not retain any state between invocations of
53 * [computeFixes]. 55 * [computeFixes].
54 * 56 *
55 * Clients are expected to subtype this class when implementing plugins. 57 * Clients are expected to subtype this class when implementing plugins.
56 */ 58 */
57 abstract class FixContributor { 59 abstract class FixContributor {
58 /** 60 /**
59 * Return a list of fixes for the given [error]. The error was reported 61 * Return a list of fixes for the given [error]. The error was reported
60 * after it's source was analyzed in the given [context]. 62 * after it's source was analyzed in the given [context].
61 */ 63 */
62 List<Fix> computeFixes(AnalysisContext context, AnalysisError error); 64 List<Fix> computeFixes(ResourceProvider resourceProvider,
65 AnalysisContext context, AnalysisError error);
63 } 66 }
64 67
65 /** 68 /**
66 * A description of a class of fixes. Instances are intended to hold the 69 * A description of a class of fixes. Instances are intended to hold the
67 * information that is common across a number of fixes and to be shared by those 70 * information that is common across a number of fixes and to be shared by those
68 * fixes. For example, if an unnecessary cast is found then one of the suggested 71 * fixes. For example, if an unnecessary cast is found then one of the suggested
69 * fixes will be to remove the cast. If there are multiple unnecessary casts in 72 * fixes will be to remove the cast. If there are multiple unnecessary casts in
70 * a single file, then there will be multiple fixes, one per occurance, but they 73 * a single file, then there will be multiple fixes, one per occurance, but they
71 * will all share the same kind. 74 * will all share the same kind.
72 * 75 *
(...skipping 18 matching lines...) Expand all
91 94
92 /** 95 /**
93 * Initialize a newly created kind of fix to have the given [name], 96 * Initialize a newly created kind of fix to have the given [name],
94 * [relevance] and [message]. 97 * [relevance] and [message].
95 */ 98 */
96 const FixKind(this.name, this.relevance, this.message); 99 const FixKind(this.name, this.relevance, this.message);
97 100
98 @override 101 @override
99 String toString() => name; 102 String toString() => name;
100 } 103 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/edit/fix/fix_dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698