| Index: pkg/analysis_server/lib/src/services/completion/dart/inherited_contributor.dart
|
| diff --git a/pkg/analysis_server/lib/src/services/completion/dart/inherited_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/inherited_contributor.dart
|
| index 2ab41e3daa40a674273edc86864742333c2a9bbd..d60076b642ec2cc12ff5de1d28768f0002729415 100644
|
| --- a/pkg/analysis_server/lib/src/services/completion/dart/inherited_contributor.dart
|
| +++ b/pkg/analysis_server/lib/src/services/completion/dart/inherited_contributor.dart
|
| @@ -13,8 +13,8 @@ import 'package:analysis_server/src/protocol_server.dart' as protocol
|
| import 'package:analysis_server/src/provisional/completion/completion_core.dart';
|
| import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
| import 'package:analysis_server/src/provisional/completion/dart/completion_target.dart';
|
| +import 'package:analyzer/dart/element/element.dart';
|
| import 'package:analyzer/src/generated/ast.dart';
|
| -import 'package:analyzer/src/generated/element.dart';
|
| import 'package:analyzer/src/generated/resolver.dart';
|
| import 'package:analyzer/src/generated/source.dart';
|
|
|
| @@ -59,27 +59,6 @@ class InheritedContributor implements DartCompletionContributor {
|
| }
|
|
|
| /**
|
| - * If the target looks like a partial identifier inside a class declaration
|
| - * then return that identifier, otherwise return `null`.
|
| - */
|
| - SimpleIdentifier _getTargetId(CompletionTarget target) {
|
| - AstNode node = target.containingNode;
|
| - if (node is ClassDeclaration) {
|
| - Object entity = target.entity;
|
| - if (entity is FieldDeclaration) {
|
| - NodeList<VariableDeclaration> variables = entity.fields.variables;
|
| - if (variables.length == 1) {
|
| - SimpleIdentifier targetId = variables[0].name;
|
| - if (targetId.name.isEmpty) {
|
| - return targetId;
|
| - }
|
| - }
|
| - }
|
| - }
|
| - return null;
|
| - }
|
| -
|
| - /**
|
| * Return a template for an override of the given [element] in the given
|
| * [source]. If selected, the template will replace [targetId].
|
| */
|
| @@ -140,6 +119,27 @@ class InheritedContributor implements DartCompletionContributor {
|
| }
|
|
|
| /**
|
| + * If the target looks like a partial identifier inside a class declaration
|
| + * then return that identifier, otherwise return `null`.
|
| + */
|
| + SimpleIdentifier _getTargetId(CompletionTarget target) {
|
| + AstNode node = target.containingNode;
|
| + if (node is ClassDeclaration) {
|
| + Object entity = target.entity;
|
| + if (entity is FieldDeclaration) {
|
| + NodeList<VariableDeclaration> variables = entity.fields.variables;
|
| + if (variables.length == 1) {
|
| + SimpleIdentifier targetId = variables[0].name;
|
| + if (targetId.name.isEmpty) {
|
| + return targetId;
|
| + }
|
| + }
|
| + }
|
| + }
|
| + return null;
|
| + }
|
| +
|
| + /**
|
| * Return `true` if the given [classElement] directly declares a member with
|
| * the given [memberName].
|
| */
|
|
|