Chromium Code Reviews| 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 082260d4910f0af36626faa9deac0ef0ec8e7a7f..be9d053cd9261425e11a67849e066959e2b85d80 100644 |
| --- a/pkg/analysis_server/lib/src/services/completion/local_computer.dart |
| +++ b/pkg/analysis_server/lib/src/services/completion/local_computer.dart |
| @@ -308,8 +308,17 @@ class _LocalVisitor extends LocalDeclarationVisitor { |
| @override |
| visitTypeName(TypeName node) { |
| // If suggesting completions within a TypeName node |
| - // then limit suggestions to only types |
| - typesOnly = true; |
| + // then limit suggestions to only types in specific situations |
|
Paul Berry
2014/12/15 16:32:19
The logic here looks exactly the same as the corre
danrubel
2014/12/16 08:04:59
Per discussion, I added a TODO here and will addre
|
| + 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); |
| } |