Skip to content

Commit

Permalink
Add two failing tests in the local_reference_contributor_test.dart, a…
Browse files Browse the repository at this point in the history
…fter some for(var foo ...) ^, the completion is in the implicit statement which is in the scope of the foo declaration.

I imagine that similar tests could/ should be written for other such ASTs.

Change-Id: Iea059af339e5dec34a937ed2c28fe55fdb072fc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
  • Loading branch information
jwren authored and commit-bot@chromium.org committed Jul 6, 2020
1 parent 1b1fcc0 commit 1a60f94
Showing 1 changed file with 26 additions and 0 deletions.
Expand Up @@ -2995,6 +2995,32 @@ main() {
assertNotSuggested('String');
}

@failingTest
Future<void> test_ForEachStatement_statement_typed() async {
// Statement ForEachStatement
addTestSource('main(args) {for (int foo in bar) ^}');
await computeSuggestions();

expect(replacementOffset, completionOffset);
expect(replacementLength, 0);
assertSuggestParameter('args', null);
assertSuggestLocalVariable('foo', 'int');
assertNotSuggested('Object');
}

@failingTest
Future<void> test_ForEachStatement_statement_untyped() async {
// Statement ForEachStatement
addTestSource('main(args) {for (var foo in bar) ^}');
await computeSuggestions();

expect(replacementOffset, completionOffset);
expect(replacementLength, 0);
assertSuggestParameter('args', null);
assertSuggestLocalVariable('foo', null);
assertNotSuggested('Object');
}

Future<void> test_FormalParameterList() async {
// FormalParameterList MethodDeclaration
addTestSource('''
Expand Down

0 comments on commit 1a60f94

Please sign in to comment.