| Index: pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart
|
| diff --git a/pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart b/pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart
|
| index 5a52da8f134d8c03e108567d3e21e9f410d3908f..b6fe585de589e2f41ffafc4016540fccd674bc2d 100644
|
| --- a/pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart
|
| +++ b/pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart
|
| @@ -96,73 +96,6 @@ class _ExpressionSuggestionBuilder implements SuggestionBuilder {
|
| }
|
|
|
| /**
|
| - * A suggestion builder for 'this.' constructor arguments.
|
| - */
|
| -class _FieldFormalSuggestionBuilder implements SuggestionBuilder {
|
| - final DartCompletionRequest request;
|
| -
|
| - _FieldFormalSuggestionBuilder(this.request);
|
| -
|
| - @override
|
| - bool computeFast(AstNode node) {
|
| - if (node is FieldFormalParameter) {
|
| - ConstructorDeclaration constructorDecl =
|
| - node.getAncestor((p) => p is ConstructorDeclaration);
|
| - if (constructorDecl != null) {
|
| - // Compute fields already referenced
|
| - List<String> referencedFields = new List<String>();
|
| - for (FormalParameter param in constructorDecl.parameters.parameters) {
|
| - if (param is FieldFormalParameter) {
|
| - SimpleIdentifier fieldId = param.identifier;
|
| - if (fieldId != null && fieldId != request.target.entity) {
|
| - String fieldName = fieldId.name;
|
| - if (fieldName != null && fieldName.length > 0) {
|
| - referencedFields.add(fieldName);
|
| - }
|
| - }
|
| - }
|
| - }
|
| -
|
| - // Add suggestions for fields that are not already referenced
|
| - ClassDeclaration classDecl =
|
| - constructorDecl.getAncestor((p) => p is ClassDeclaration);
|
| - for (ClassMember member in classDecl.members) {
|
| - if (member is FieldDeclaration && !member.isStatic) {
|
| - for (VariableDeclaration varDecl in member.fields.variables) {
|
| - SimpleIdentifier fieldId = varDecl.name;
|
| - if (fieldId != null) {
|
| - String fieldName = fieldId.name;
|
| - if (fieldName != null && fieldName.length > 0) {
|
| - if (!referencedFields.contains(fieldName)) {
|
| - CompletionSuggestion suggestion =
|
| - createFieldSuggestion(request.source, member, varDecl);
|
| - if (suggestion != null) {
|
| - request.addSuggestion(suggestion);
|
| - }
|
| - }
|
| - }
|
| - }
|
| - }
|
| - }
|
| - }
|
| - }
|
| - } else {
|
| - // This should never be called with a case not handled above.
|
| - assert(false);
|
| - }
|
| - return true;
|
| - }
|
| -
|
| - @override
|
| - Future<bool> computeFull(AstNode node) {
|
| - // This should never be called; we should always be able to compute
|
| - // suggestions and return true in computeFast method.
|
| - assert(false);
|
| - return null;
|
| - }
|
| -}
|
| -
|
| -/**
|
| * An [AstNode] vistor for determining which suggestion builder
|
| * should be used to build invocation/access suggestions.
|
| */
|
| @@ -179,11 +112,6 @@ class _InvocationAstVisitor extends GeneralizingAstVisitor<SuggestionBuilder> {
|
| }
|
|
|
| @override
|
| - SuggestionBuilder visitFieldFormalParameter(FieldFormalParameter node) {
|
| - return new _FieldFormalSuggestionBuilder(request);
|
| - }
|
| -
|
| - @override
|
| SuggestionBuilder visitMethodInvocation(MethodInvocation node) {
|
| return new _ExpressionSuggestionBuilder(request);
|
| }
|
|
|