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

Unified Diff: pkg/analysis_server/lib/src/services/correction/util.dart

Issue 1629533003: Issue 25404. 'Inline Method' should update implicit 'this' and class references. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/refactoring/inline_method.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/services/correction/util.dart
diff --git a/pkg/analysis_server/lib/src/services/correction/util.dart b/pkg/analysis_server/lib/src/services/correction/util.dart
index 33a31052474bfd976e39df83f3b2b15cfc876b56..ef836c1b99824a46c989b4fd9ad18bac2113648d 100644
--- a/pkg/analysis_server/lib/src/services/correction/util.dart
+++ b/pkg/analysis_server/lib/src/services/correction/util.dart
@@ -396,17 +396,14 @@ AstNode getNearestCommonAncestor(List<AstNode> nodes) {
*/
Expression getNodeQualifier(SimpleIdentifier node) {
AstNode parent = node.parent;
- if (parent is PropertyAccess) {
- PropertyAccess propertyAccess = parent;
- if (identical(propertyAccess.propertyName, node)) {
- return propertyAccess.target;
- }
+ if (parent is MethodInvocation && identical(parent.methodName, node)) {
+ return parent.target;
}
- if (parent is PrefixedIdentifier) {
- PrefixedIdentifier prefixed = parent;
- if (identical(prefixed.identifier, node)) {
- return prefixed.prefix;
- }
+ if (parent is PropertyAccess && identical(parent.propertyName, node)) {
+ return parent.target;
+ }
+ if (parent is PrefixedIdentifier && identical(parent.identifier, node)) {
+ return parent.prefix;
}
return null;
}
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/refactoring/inline_method.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698