Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1003)

Unified Diff: pkg/analysis_server/lib/src/services/completion/dart/inherited_contributor.dart

Issue 1527793003: Clean up imports in analysis_server and analyzer_cli (and one missed in analyzer) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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].
*/

Powered by Google App Engine
This is Rietveld 408576698