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

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

Issue 2622303006: Reapply "Add support for generic function type syntax, part 1" (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/optype.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/optype.dart b/pkg/analysis_server/lib/src/services/completion/dart/optype.dart
index da0e6a03ef924391f368ac76c93b13d8bb24bead..c9954d5caea2741268c9f065248b9c4eb096fc1d 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/optype.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/optype.dart
@@ -126,15 +126,6 @@ class OpType {
OpType._();
/**
- * Indicate whether only type names should be suggested
- */
- bool get includeOnlyNamedArgumentSuggestions =>
- includeNamedArgumentSuggestions &&
- !includeTypeNameSuggestions &&
- !includeReturnValueSuggestions &&
- !includeVoidReturnSuggestions;
-
- /**
* Return `true` if free standing identifiers should be suggested
*/
bool get includeIdentifiers {
@@ -148,6 +139,15 @@ class OpType {
/**
* Indicate whether only type names should be suggested
*/
+ bool get includeOnlyNamedArgumentSuggestions =>
+ includeNamedArgumentSuggestions &&
+ !includeTypeNameSuggestions &&
+ !includeReturnValueSuggestions &&
+ !includeVoidReturnSuggestions;
+
+ /**
+ * Indicate whether only type names should be suggested
+ */
bool get includeOnlyTypeNameSuggestions =>
includeTypeNameSuggestions &&
!includeNamedArgumentSuggestions &&
@@ -845,9 +845,9 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor {
@override
void visitTypeArgumentList(TypeArgumentList node) {
- NodeList<TypeName> arguments = node.arguments;
- for (TypeName typeName in arguments) {
- if (identical(entity, typeName)) {
+ NodeList<TypeAnnotation> arguments = node.arguments;
+ for (TypeAnnotation type in arguments) {
+ if (identical(entity, type)) {
optype.includeTypeNameSuggestions = true;
break;
}

Powered by Google App Engine
This is Rietveld 408576698