| Index: pkg/analysis_server/lib/src/services/completion/optype.dart
|
| diff --git a/pkg/analysis_server/lib/src/services/completion/optype.dart b/pkg/analysis_server/lib/src/services/completion/optype.dart
|
| index cba56957243a1931b1da0629605c3b439c36503d..5bb865d18556b6e15a5a1fc7936b3aea9d7606cc 100644
|
| --- a/pkg/analysis_server/lib/src/services/completion/optype.dart
|
| +++ b/pkg/analysis_server/lib/src/services/completion/optype.dart
|
| @@ -139,6 +139,22 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor {
|
| @override
|
| void visitBinaryExpression(BinaryExpression node) {
|
| if (identical(entity, node.rightOperand)) {
|
| + // An empty type argument list is parsed as a binary expression
|
| + // `C<>` is parsed as `C < `
|
| + Object entity = this.entity;
|
| + if (entity is SimpleIdentifier && entity.isSynthetic) {
|
| + Token operator = node.operator;
|
| + if (operator != null && operator.lexeme == '<') {
|
| + Token next = entity.token.next;
|
| + if (next is StringToken && next.lexeme.length == 0) {
|
| + next = next.next;
|
| + }
|
| + if (next != null && next.lexeme == '>') {
|
| + optype.includeTypeNameSuggestions = true;
|
| + return;
|
| + }
|
| + }
|
| + }
|
| optype.includeReturnValueSuggestions = true;
|
| optype.includeTypeNameSuggestions = true;
|
| }
|
| @@ -496,6 +512,17 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor {
|
| }
|
|
|
| @override
|
| + visitTypeArgumentList(TypeArgumentList node) {
|
| + NodeList<TypeName> arguments = node.arguments;
|
| + for (TypeName typeName in arguments) {
|
| + if (identical(entity, typeName)) {
|
| + optype.includeTypeNameSuggestions = true;
|
| + break;
|
| + }
|
| + }
|
| + }
|
| +
|
| + @override
|
| void visitTypeName(TypeName node) {
|
| // The entity won't be the first child entity (node.name), since
|
| // CompletionTarget would have chosen an edge higher in the parse tree. So
|
|
|