| OLD | NEW |
| 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; |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 abstract class InlineMethodRefactoring implements Refactoring { | 209 abstract class InlineMethodRefactoring implements Refactoring { |
| 210 /** | 210 /** |
| 211 * Returns a new [InlineMethodRefactoring] instance. | 211 * Returns a new [InlineMethodRefactoring] instance. |
| 212 */ | 212 */ |
| 213 factory InlineMethodRefactoring(SearchEngine searchEngine, | 213 factory InlineMethodRefactoring(SearchEngine searchEngine, |
| 214 CompilationUnit unit, int offset) { | 214 CompilationUnit unit, int offset) { |
| 215 return new InlineMethodRefactoringImpl(searchEngine, unit, offset); | 215 return new InlineMethodRefactoringImpl(searchEngine, unit, offset); |
| 216 } | 216 } |
| 217 | 217 |
| 218 /** | 218 /** |
| 219 * The name of the class enclosing the method being inlined. |
| 220 * If not a class member is being inlined, then `null`. |
| 221 */ |
| 222 String get className; |
| 223 |
| 224 /** |
| 219 * True if the method being inlined should be removed. | 225 * True if the method being inlined should be removed. |
| 220 * It is an error if this field is `true` and [inlineAll] is `false`. | 226 * It is an error if this field is `true` and [inlineAll] is `false`. |
| 221 */ | 227 */ |
| 222 void set deleteSource(bool deleteSource); | 228 void set deleteSource(bool deleteSource); |
| 223 | 229 |
| 224 /** | 230 /** |
| 225 * True if all invocations of the method should be inlined, or false if only | 231 * True if all invocations of the method should be inlined, or false if only |
| 226 * the invocation site used to create this refactoring should be inlined. | 232 * the invocation site used to create this refactoring should be inlined. |
| 227 */ | 233 */ |
| 228 void set inlineAll(bool inlineAll); | 234 void set inlineAll(bool inlineAll); |
| 235 |
| 236 /** |
| 237 * True if the declaration of the method is selected. |
| 238 * So, all references should be inlined. |
| 239 */ |
| 240 bool get isDeclaration; |
| 241 |
| 242 /** |
| 243 * The name of the method (or function) being inlined. |
| 244 */ |
| 245 String get methodName; |
| 229 } | 246 } |
| 230 | 247 |
| 231 | 248 |
| 232 /** | 249 /** |
| 233 * Abstract interface for all refactorings. | 250 * Abstract interface for all refactorings. |
| 234 */ | 251 */ |
| 235 abstract class Refactoring { | 252 abstract class Refactoring { |
| 236 /** | 253 /** |
| 237 * The ids of source edits that are not known to be valid. | 254 * The ids of source edits that are not known to be valid. |
| 238 * | 255 * |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 * Validates that the [newName] is a valid identifier and is appropriate for | 353 * Validates that the [newName] is a valid identifier and is appropriate for |
| 337 * the type of the [Element] being renamed. | 354 * the type of the [Element] being renamed. |
| 338 * | 355 * |
| 339 * It does not perform all the checks (such as checking for conflicts with any | 356 * It does not perform all the checks (such as checking for conflicts with any |
| 340 * existing names in any of the scopes containing the current name), as many | 357 * existing names in any of the scopes containing the current name), as many |
| 341 * of these checkes require search engine. Use [checkFinalConditions] for this | 358 * of these checkes require search engine. Use [checkFinalConditions] for this |
| 342 * level of checking. | 359 * level of checking. |
| 343 */ | 360 */ |
| 344 RefactoringStatus checkNewName(); | 361 RefactoringStatus checkNewName(); |
| 345 } | 362 } |
| OLD | NEW |