| 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 cf4a551335b1231c1fcb9bb3a8acaa7805f13f13..d597ffaff0c61c1d1fa10b00b5ee6a84c1af78e5 100644
|
| --- a/pkg/analysis_server/test/services/completion/completion_test_util.dart
|
| +++ b/pkg/analysis_server/test/services/completion/completion_test_util.dart
|
| @@ -10,6 +10,7 @@ import 'package:analysis_server/src/protocol.dart' as protocol show Element,
|
| ElementKind;
|
| import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind;
|
| import 'package:analysis_server/src/services/completion/completion_manager.dart';
|
| +import 'package:analysis_server/src/services/completion/completion_target.dart';
|
| import 'package:analysis_server/src/services/completion/dart_completion_cache.dart';
|
| import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
|
| import 'package:analysis_server/src/services/completion/imported_computer.dart';
|
| @@ -421,6 +422,7 @@ abstract class AbstractCompletionTest extends AbstractContextTest {
|
| new NodeLocator.con1(completionOffset).searchWithin(testUnit);
|
| request.unit = testUnit;
|
| request.node = completionNode;
|
| + request.target = new CompletionTarget.forOffset(testUnit, completionOffset);
|
| return computer.computeFast(request);
|
| }
|
|
|
| @@ -949,46 +951,46 @@ abstract class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
|
| });
|
| }
|
|
|
| - test_AssignmentExpression_type_partial() {
|
| + test_AssignmentExpression_type_newline() {
|
| // SimpleIdentifier TypeName VariableDeclarationList
|
| // VariableDeclarationStatement Block
|
| addTestSource('''
|
| class A {} main() {
|
| int a;
|
| - int^ b = 1;}''');
|
| + ^
|
| + b = 1;}''');
|
| computeFast();
|
| return computeFull((bool result) {
|
| assertSuggestLocalClass('A');
|
| assertSuggestImportedClass('int');
|
| - // TODO (danrubel) When entering 1st of 2 identifiers on assignment LHS
|
| - // the user may be either (1) entering a type for the assignment
|
| - // or (2) starting a new statement.
|
| - // Consider suggesting only types
|
| - // if only spaces separates the 1st and 2nd identifiers.
|
| - //assertNotSuggested('a');
|
| - //assertNotSuggested('main');
|
| - //assertNotSuggested('identical');
|
| + // Allow non-types preceding an identifier on LHS of assignment
|
| + // if newline follows first identifier
|
| + // because user is probably starting a new statement
|
| + assertSuggestLocalVariable('a', 'int');
|
| + assertSuggestLocalFunction('main', null);
|
| + assertSuggestImportedFunction('identical', 'bool');
|
| });
|
| }
|
|
|
| - test_AssignmentExpression_type_newline() {
|
| + test_AssignmentExpression_type_partial() {
|
| // SimpleIdentifier TypeName VariableDeclarationList
|
| // VariableDeclarationStatement Block
|
| addTestSource('''
|
| class A {} main() {
|
| int a;
|
| - ^
|
| - b = 1;}''');
|
| + int^ b = 1;}''');
|
| computeFast();
|
| return computeFull((bool result) {
|
| assertSuggestLocalClass('A');
|
| assertSuggestImportedClass('int');
|
| - // Allow non-types preceding an identifier on LHS of assignment
|
| - // if newline follows first identifier
|
| - // because user is probably starting a new statement
|
| - assertSuggestLocalVariable('a', 'int');
|
| - assertSuggestLocalFunction('main', null);
|
| - assertSuggestImportedFunction('identical', 'bool');
|
| + // TODO (danrubel) When entering 1st of 2 identifiers on assignment LHS
|
| + // the user may be either (1) entering a type for the assignment
|
| + // or (2) starting a new statement.
|
| + // Consider suggesting only types
|
| + // if only spaces separates the 1st and 2nd identifiers.
|
| + //assertNotSuggested('a');
|
| + //assertNotSuggested('main');
|
| + //assertNotSuggested('identical');
|
| });
|
| }
|
|
|
|
|