| Index: pkg/analysis_server/lib/src/services/completion/local_computer.dart
|
| diff --git a/pkg/analysis_server/lib/src/services/completion/local_computer.dart b/pkg/analysis_server/lib/src/services/completion/local_computer.dart
|
| index c120c56501e3f80f1806b3880d20c30a70b6e8f8..8e6e9d9c4d46e548117fb0cac2d9f3bb4f126b87 100644
|
| --- a/pkg/analysis_server/lib/src/services/completion/local_computer.dart
|
| +++ b/pkg/analysis_server/lib/src/services/completion/local_computer.dart
|
| @@ -317,9 +317,20 @@ class _LocalVisitor extends LocalDeclarationVisitor {
|
|
|
| @override
|
| visitTypeName(TypeName node) {
|
| + // TODO (danrubel) refactor this and imported_computer
|
| + // to reduce duplicate code
|
| // If suggesting completions within a TypeName node
|
| - // then limit suggestions to only types
|
| - typesOnly = true;
|
| + // then limit suggestions to only types in specific situations
|
| + AstNode p = node.parent;
|
| + if (p is IsExpression || p is ConstructorName || p is AsExpression) {
|
| + typesOnly = true;
|
| + } else if (p is VariableDeclarationList) {
|
| + // 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.
|
| + }
|
| return visitNode(node);
|
| }
|
|
|
|
|