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

Side by Side Diff: pkg/analysis_server/lib/edit/fix/fix_dart.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
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_dart; 5 library analysis_server.edit.fix.fix_dart;
6 6
7 import 'package:analysis_server/edit/fix/fix_core.dart'; 7 import 'package:analysis_server/edit/fix/fix_core.dart';
8 import 'package:analyzer/file_system/file_system.dart';
8 import 'package:analyzer/src/generated/ast.dart'; 9 import 'package:analyzer/src/generated/ast.dart';
9 import 'package:analyzer/src/generated/engine.dart'; 10 import 'package:analyzer/src/generated/engine.dart';
10 import 'package:analyzer/src/generated/error.dart'; 11 import 'package:analyzer/src/generated/error.dart';
11 import 'package:analyzer/src/generated/source.dart'; 12 import 'package:analyzer/src/generated/source.dart';
12 13
13 /** 14 /**
14 * A [FixContributor] that can be used to contribute fixes for errors in Dart 15 * A [FixContributor] that can be used to contribute fixes for errors in Dart
15 * files. 16 * files.
16 * 17 *
17 * Clients are expected to subtype this class when implementing plugins. 18 * Clients are expected to subtype this class when implementing plugins.
18 */ 19 */
19 abstract class DartFixContributor extends FixContributor { 20 abstract class DartFixContributor extends FixContributor {
20 @override 21 @override
21 List<Fix> computeFixes(AnalysisContext context, AnalysisError error) { 22 List<Fix> computeFixes(ResourceProvider resourceProvider,
23 AnalysisContext context, AnalysisError error) {
22 Source source = error.source; 24 Source source = error.source;
23 if (!AnalysisEngine.isDartFileName(source.fullName)) { 25 if (!AnalysisEngine.isDartFileName(source.fullName)) {
24 return Fix.EMPTY_LIST; 26 return Fix.EMPTY_LIST;
25 } 27 }
26 List<Source> libraries = context.getLibrariesContaining(source); 28 List<Source> libraries = context.getLibrariesContaining(source);
27 if (libraries.isEmpty) { 29 if (libraries.isEmpty) {
28 return Fix.EMPTY_LIST; 30 return Fix.EMPTY_LIST;
29 } 31 }
30 CompilationUnit unit = 32 CompilationUnit unit =
31 context.resolveCompilationUnit2(source, libraries[0]); 33 context.resolveCompilationUnit2(source, libraries[0]);
32 if (unit == null) { 34 if (unit == null) {
33 return Fix.EMPTY_LIST; 35 return Fix.EMPTY_LIST;
34 } 36 }
35 return internalComputeFixes(unit, error); 37 return internalComputeFixes(resourceProvider, unit, error);
36 } 38 }
37 39
38 /** 40 /**
39 * Return a list of fixes for the given [error]. The error was reported 41 * Return a list of fixes for the given [error]. The error was reported
40 * against the given compilation [unit]. 42 * against the given compilation [unit].
41 */ 43 */
42 List<Fix> internalComputeFixes(CompilationUnit unit, AnalysisError error); 44 List<Fix> internalComputeFixes(ResourceProvider resourceProvider,
45 CompilationUnit unit, AnalysisError error);
43 } 46 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/edit/fix/fix_core.dart ('k') | pkg/analysis_server/lib/src/edit/edit_domain.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698