| Index: pkg/analysis_server/lib/src/services/refactoring/inline_method.dart
|
| diff --git a/pkg/analysis_server/lib/src/services/refactoring/inline_method.dart b/pkg/analysis_server/lib/src/services/refactoring/inline_method.dart
|
| index ae55c052cee2ef4ee9360a2a6bae7dd82aca05cb..42316c207c214e0078cc03ee215013c303ec4905 100644
|
| --- a/pkg/analysis_server/lib/src/services/refactoring/inline_method.dart
|
| +++ b/pkg/analysis_server/lib/src/services/refactoring/inline_method.dart
|
| @@ -173,6 +173,7 @@ class InlineMethodRefactoringImpl extends RefactoringImpl implements
|
| CorrectionUtils utils;
|
| SourceChange change;
|
|
|
| + bool isDeclaration = false;
|
| bool deleteSource = false;
|
| bool inlineAll = true;
|
|
|
| @@ -194,6 +195,26 @@ class InlineMethodRefactoringImpl extends RefactoringImpl implements
|
| }
|
|
|
| @override
|
| + String get className {
|
| + if (_methodElement == null) {
|
| + return null;
|
| + }
|
| + Element classElement = _methodElement.enclosingElement;
|
| + if (classElement is ClassElement) {
|
| + return classElement.displayName;
|
| + }
|
| + return null;
|
| + }
|
| +
|
| + @override
|
| + String get methodName {
|
| + if (_methodElement == null) {
|
| + return null;
|
| + }
|
| + return _methodElement.displayName;
|
| + }
|
| +
|
| + @override
|
| String get refactoringName {
|
| if (_methodElement is MethodElement) {
|
| return "Inline Method";
|
| @@ -304,7 +325,8 @@ class InlineMethodRefactoringImpl extends RefactoringImpl implements
|
| _methodParameters = methodDeclaration.parameters;
|
| _methodBody = methodDeclaration.body;
|
| // prepare mode
|
| - deleteSource = selectedNode == methodDeclaration.name;
|
| + isDeclaration = selectedNode == methodDeclaration.name;
|
| + deleteSource = isDeclaration;
|
| inlineAll = deleteSource;
|
| }
|
| if (selectedElement is FunctionElement) {
|
| @@ -314,7 +336,8 @@ class InlineMethodRefactoringImpl extends RefactoringImpl implements
|
| _methodParameters = functionDeclaration.functionExpression.parameters;
|
| _methodBody = functionDeclaration.functionExpression.body;
|
| // prepare mode
|
| - deleteSource = selectedNode == functionDeclaration.name;
|
| + isDeclaration = selectedNode == functionDeclaration.name;
|
| + deleteSource = isDeclaration;
|
| inlineAll = deleteSource;
|
| }
|
| // OK
|
|
|