| Index: pkg/analysis_server/lib/src/services/completion/imported_computer.dart
|
| diff --git a/pkg/analysis_server/lib/src/services/completion/imported_computer.dart b/pkg/analysis_server/lib/src/services/completion/imported_computer.dart
|
| index 5b0d947e20b52a561e591de59c4d438abd18dbd0..8bc96086bf9775edee22948d667eb2360befbc2d 100644
|
| --- a/pkg/analysis_server/lib/src/services/completion/imported_computer.dart
|
| +++ b/pkg/analysis_server/lib/src/services/completion/imported_computer.dart
|
| @@ -196,7 +196,20 @@ class _ImportedAstVisitor extends
|
|
|
| @override
|
| _ImportedSuggestionBuilder visitTypeName(TypeName node) {
|
| - return new _ImportedSuggestionBuilder(request, typesOnly: true);
|
| + bool typesOnly = false;
|
| + // If suggesting completions within a TypeName node
|
| + // 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 new _ImportedSuggestionBuilder(request, typesOnly: typesOnly);
|
| }
|
|
|
| @override
|
|
|