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

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

Issue 592643002: 'Convert Method to Getter' refactoring implementation. (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 unified diff | Download patch | Annotate | Revision Log
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 library services.refactoring; 5 library services.refactoring;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/protocol.dart' show 9 import 'package:analysis_server/src/protocol.dart' show
10 RefactoringMethodParameter, SourceChange; 10 RefactoringMethodParameter, SourceChange;
11 import 'package:analysis_server/src/services/correction/status.dart'; 11 import 'package:analysis_server/src/services/correction/status.dart';
12 import 'package:analysis_server/src/services/refactoring/convert_method_to_gette r.dart';
12 import 'package:analysis_server/src/services/refactoring/extract_local.dart'; 13 import 'package:analysis_server/src/services/refactoring/extract_local.dart';
13 import 'package:analysis_server/src/services/refactoring/extract_method.dart'; 14 import 'package:analysis_server/src/services/refactoring/extract_method.dart';
14 import 'package:analysis_server/src/services/refactoring/inline_local.dart'; 15 import 'package:analysis_server/src/services/refactoring/inline_local.dart';
15 import 'package:analysis_server/src/services/refactoring/inline_method.dart'; 16 import 'package:analysis_server/src/services/refactoring/inline_method.dart';
16 import 'package:analysis_server/src/services/refactoring/move_file.dart'; 17 import 'package:analysis_server/src/services/refactoring/move_file.dart';
17 import 'package:analysis_server/src/services/refactoring/rename_class_member.dar t'; 18 import 'package:analysis_server/src/services/refactoring/rename_class_member.dar t';
18 import 'package:analysis_server/src/services/refactoring/rename_constructor.dart '; 19 import 'package:analysis_server/src/services/refactoring/rename_constructor.dart ';
19 import 'package:analysis_server/src/services/refactoring/rename_import.dart'; 20 import 'package:analysis_server/src/services/refactoring/rename_import.dart';
20 import 'package:analysis_server/src/services/refactoring/rename_label.dart'; 21 import 'package:analysis_server/src/services/refactoring/rename_label.dart';
21 import 'package:analysis_server/src/services/refactoring/rename_library.dart'; 22 import 'package:analysis_server/src/services/refactoring/rename_library.dart';
22 import 'package:analysis_server/src/services/refactoring/rename_local.dart'; 23 import 'package:analysis_server/src/services/refactoring/rename_local.dart';
23 import 'package:analysis_server/src/services/refactoring/rename_unit_member.dart '; 24 import 'package:analysis_server/src/services/refactoring/rename_unit_member.dart ';
24 import 'package:analysis_server/src/services/search/search_engine.dart'; 25 import 'package:analysis_server/src/services/search/search_engine.dart';
25 import 'package:analyzer/src/generated/ast.dart'; 26 import 'package:analyzer/src/generated/ast.dart';
26 import 'package:analyzer/src/generated/element.dart'; 27 import 'package:analyzer/src/generated/element.dart';
27 import 'package:analyzer/src/generated/engine.dart'; 28 import 'package:analyzer/src/generated/engine.dart';
28 import 'package:analyzer/src/generated/source.dart'; 29 import 'package:analyzer/src/generated/source.dart';
29 30
30 31
31 /** 32 /**
33 * [Refactoring] to convert normal [MethodDeclaration]s into getters.
34 */
35 abstract class ConvertMethodToGetterRefactoring implements Refactoring {
36 /**
37 * Returns a new [ConvertMethodToGetterRefactoring] instance for converting
38 * [element] and all the corresponding hierarchy elements.
39 */
40 factory ConvertMethodToGetterRefactoring(SearchEngine searchEngine,
41 ExecutableElement element) {
42 return new ConvertMethodToGetterRefactoringImpl(searchEngine, element);
43 }
44 }
45
46
47 /**
32 * [Refactoring] to extract an expression into a local variable declaration. 48 * [Refactoring] to extract an expression into a local variable declaration.
33 */ 49 */
34 abstract class ExtractLocalRefactoring implements Refactoring { 50 abstract class ExtractLocalRefactoring implements Refactoring {
35 /** 51 /**
36 * Returns a new [ExtractLocalRefactoring] instance. 52 * Returns a new [ExtractLocalRefactoring] instance.
37 */ 53 */
38 factory ExtractLocalRefactoring(CompilationUnit unit, int selectionOffset, 54 factory ExtractLocalRefactoring(CompilationUnit unit, int selectionOffset,
39 int selectionLength) { 55 int selectionLength) {
40 return new ExtractLocalRefactoringImpl( 56 return new ExtractLocalRefactoringImpl(
41 unit, 57 unit,
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 * Validates that the [newName] is a valid identifier and is appropriate for 395 * Validates that the [newName] is a valid identifier and is appropriate for
380 * the type of the [Element] being renamed. 396 * the type of the [Element] being renamed.
381 * 397 *
382 * It does not perform all the checks (such as checking for conflicts with any 398 * It does not perform all the checks (such as checking for conflicts with any
383 * existing names in any of the scopes containing the current name), as many 399 * existing names in any of the scopes containing the current name), as many
384 * of these checkes require search engine. Use [checkFinalConditions] for this 400 * of these checkes require search engine. Use [checkFinalConditions] for this
385 * level of checking. 401 * level of checking.
386 */ 402 */
387 RefactoringStatus checkNewName(); 403 RefactoringStatus checkNewName();
388 } 404 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698