Don't propose 'Assign to local variable' when in arguments list.
R=brianwilkerson@google.com BUG= Review URL: https://codereview.chromium.org//943053005 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44036 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
@@ -362,6 +362,11 @@ class AssistProcessor {
|
||||
// prepare expression
|
||||
Expression expression = expressionStatement.expression;
|
||||
int offset = expression.offset;
|
||||
// ignore if in arguments
|
||||
if (node.getAncestor((node) => node is ArgumentList) != null) {
|
||||
_coverageMarker();
|
||||
return;
|
||||
}
|
||||
// ignore if already assignment
|
||||
if (expression is AssignmentExpression) {
|
||||
_coverageMarker();
|
||||
|
||||
@@ -613,6 +613,16 @@ main() {
|
||||
assertNoAssistAt('vvv =', AssistKind.ASSIGN_TO_LOCAL_VARIABLE);
|
||||
}
|
||||
|
||||
void test_assignToLocalVariable_invocationArgument() {
|
||||
resolveTestUnit(r'''
|
||||
main() {
|
||||
f(12345);
|
||||
}
|
||||
int f(p) {}
|
||||
''');
|
||||
assertNoAssistAt('345', AssistKind.ASSIGN_TO_LOCAL_VARIABLE);
|
||||
}
|
||||
|
||||
void test_assignToLocalVariable_throw() {
|
||||
resolveTestUnit('''
|
||||
main() {
|
||||
|
||||
Reference in New Issue
Block a user