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

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

Issue 2624283003: Revert "Add support for generic function type syntax, part 1" (TBR) (Closed)
Patch Set: Created 3 years, 11 months 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/variable_name_contributor.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/variable_name_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/variable_name_contributor.dart
index 98b7f4b92c6a50c1d3a3fb13e5c243c13e76124b..2c4d91352a1c618a5b62eae33685a24d75f5d3aa 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/variable_name_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/variable_name_contributor.dart
@@ -56,10 +56,7 @@ class VariableNameContributor extends DartCompletionContributor {
strName = _getStringName(node.expression as Identifier);
}
} else if (node is VariableDeclarationList) {
- TypeAnnotation typeAnnotation = node.type;
- if (typeAnnotation is TypeName) {
- strName = _getStringName(typeAnnotation.name);
- }
+ strName = _getStringName(node.type.name);
} else if (node is TopLevelVariableDeclaration) {
// The parser parses 'Foo ' and 'Foo ;' differently, resulting in the
// following.
@@ -67,11 +64,8 @@ class VariableNameContributor extends DartCompletionContributor {
// 'Foo ;': TopLevelVariableDeclaration with type null, and a first
// variable of 'Foo'
VariableDeclarationList varDeclarationList = node.variables;
- TypeAnnotation typeAnnotation = varDeclarationList.type;
- if (typeAnnotation != null) {
- if (typeAnnotation is TypeName) {
- strName = _getStringName(typeAnnotation.name);
- }
+ if (varDeclarationList.type != null) {
+ strName = _getStringName(varDeclarationList.type.name);
} else {
NodeList<VariableDeclaration> varDeclarations =
varDeclarationList.variables;

Powered by Google App Engine
This is Rietveld 408576698