| Index: pkg/analysis_server/test/services/completion/completion_test_util.dart
|
| diff --git a/pkg/analysis_server/test/services/completion/completion_test_util.dart b/pkg/analysis_server/test/services/completion/completion_test_util.dart
|
| index 2ed4cd5a682a1638dcf7c602e3660a391f46993f..6d8d7b7e4ca427b2b2ecbdd19e5edeb2915e8e62 100644
|
| --- a/pkg/analysis_server/test/services/completion/completion_test_util.dart
|
| +++ b/pkg/analysis_server/test/services/completion/completion_test_util.dart
|
| @@ -538,6 +538,56 @@ class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
|
| });
|
| }
|
|
|
| + test_AssignmentExpression_RHS() {
|
| + // SimpleIdentifier VariableDeclaration VariableDeclarationList
|
| + // VariableDeclarationStatement Block
|
| + addTestSource('class A {} main() {int a; int b = ^}');
|
| + computeFast();
|
| + return computeFull(true).then((_) {
|
| + assertSuggestLocalVariable('a', 'int');
|
| + assertSuggestLocalFunction('main', null);
|
| + assertSuggestLocalClass('A');
|
| + assertSuggestImportedClass('Object');
|
| + });
|
| + }
|
| +
|
| + test_AssignmentExpression_name() {
|
| + // SimpleIdentifier VariableDeclaration VariableDeclarationList
|
| + // VariableDeclarationStatement Block
|
| + addTestSource('class A {} main() {int a; int ^b = 1;}');
|
| + computeFast();
|
| + return computeFull(true).then((_) {
|
| + assertNoSuggestions();
|
| + });
|
| + }
|
| +
|
| + test_AssignmentExpression_type() {
|
| + // SimpleIdentifier TypeName VariableDeclarationList
|
| + // VariableDeclarationStatement Block
|
| + addTestSource('class A {} main() {int a; int^ b = 1;}');
|
| + computeFast();
|
| + return computeFull(true).then((_) {
|
| + assertSuggestLocalClass('A');
|
| + assertSuggestImportedClass('int');
|
| + assertNotSuggested('a');
|
| + assertNotSuggested('main');
|
| + });
|
| + }
|
| +
|
| + test_AwaitExpression() {
|
| + // SimpleIdentifier AwaitExpression ExpressionStatement
|
| + addTestSource('''
|
| + class A {int x; int y() => 0;}
|
| + main(){A a; await ^}''');
|
| + computeFast();
|
| + return computeFull(true).then((_) {
|
| + assertSuggestLocalVariable('a', 'A');
|
| + assertSuggestLocalFunction('main', null);
|
| + assertSuggestLocalClass('A');
|
| + assertSuggestImportedClass('Object');
|
| + });
|
| + }
|
| +
|
| test_BinaryExpression_LHS() {
|
| // SimpleIdentifier BinaryExpression VariableDeclaration
|
| // VariableDeclarationList VariableDeclarationStatement
|
| @@ -590,7 +640,7 @@ class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
|
| int T5;
|
| var _T6;
|
| Z D2() {int x;}
|
| - class X {a() {var f; {var x;} ^ var r;} Z b() { }}
|
| + class X {a() {var f; {var x;} ^ var r;} void b() { }}
|
| class Z { }''');
|
| computeFast();
|
| return computeFull(true).then((_) {
|
| @@ -598,7 +648,7 @@ class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
|
| assertSuggestLocalClass('X');
|
| assertSuggestLocalClass('Z');
|
| assertLocalSuggestMethod('a', 'X', null);
|
| - assertLocalSuggestMethod('b', 'X', 'Z');
|
| + assertLocalSuggestMethod('b', 'X', 'void');
|
| assertSuggestLocalVariable('f', null);
|
| // Don't suggest locals out of scope
|
| assertNotSuggested('r');
|
| @@ -1117,6 +1167,15 @@ class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
|
| });
|
| }
|
|
|
| + test_Literal_string() {
|
| + // SimpleStringLiteral ExpressionStatement Block
|
| + addTestSource('class A {a() {"hel^lo"}}');
|
| + computeFast();
|
| + return computeFull(true).then((_) {
|
| + assertNoSuggestions();
|
| + });
|
| + }
|
| +
|
| test_MethodDeclaration_body_getters() {
|
| // Block BlockFunctionBody MethodDeclaration
|
| addTestSource('class A {@deprecated X get f => 0; Z a() {^} get _g => 1;}');
|
|
|