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

Unified Diff: pkg/analysis_server/lib/src/services/refactoring/inline_method.dart

Issue 554053002: Return a feedback for the INLINE_METHOD refactoring. (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 side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « pkg/analysis_server/lib/src/edit/edit_domain.dart ('k') | pkg/analysis_server/lib/src/services/refactoring/refactoring.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698