Index: pkg/analysis_server/lib/src/services/refactoring/extract_local.dart |
diff --git a/pkg/analysis_server/lib/src/services/refactoring/extract_local.dart b/pkg/analysis_server/lib/src/services/refactoring/extract_local.dart |
index b9510002c57f07a89c32b408974b643a6fd0ed09..ad42a6eb27d8e9f9f1cc34959163bfe2c0630108 100644 |
--- a/pkg/analysis_server/lib/src/services/refactoring/extract_local.dart |
+++ b/pkg/analysis_server/lib/src/services/refactoring/extract_local.dart |
@@ -197,8 +197,18 @@ class ExtractLocalRefactoringImpl extends RefactoringImpl |
AstNode coveringNode = new NodeLocator( |
selectionRange.offset, selectionRange.end).searchWithin(unit); |
// compute covering expressions |
- for (AstNode node = coveringNode; node is Expression; node = node.parent) { |
+ for (AstNode node = coveringNode; |
+ node is Expression || node is ArgumentList; |
+ node = node.parent) { |
AstNode parent = node.parent; |
+ // skip ArgumentList |
+ if (node is ArgumentList) { |
+ continue; |
+ } |
+ // skip AssignmentExpression |
+ if (node is AssignmentExpression) { |
+ continue; |
+ } |
// cannot extract the name part of a property access |
if (parent is PrefixedIdentifier && parent.identifier == node || |
parent is PropertyAccess && parent.propertyName == node) { |