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

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

Issue 2771653002: Completion boilerplate for Flutter cons children (flutter-intellij#463) (Closed)
Patch Set: Created 3 years, 9 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/inherited_reference_contributor.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/inherited_reference_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/inherited_reference_contributor.dart
index 9cee6234e9d5025b83c3741aa17448bd6d07a96f..8485a8c857738342da41c9f40fe4b4fe2f030d52 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/inherited_reference_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/inherited_reference_contributor.dart
@@ -6,6 +6,7 @@ library services.completion.contributor.dart.inherited_ref;
import 'dart:async';
+import 'package:analysis_server/src/ide_options.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:analysis_server/src/services/completion/dart/optype.dart';
@@ -81,12 +82,12 @@ class InheritedReferenceContributor extends DartCompletionContributor
OpType optype = request.opType;
if (!skipChildClass) {
- _addSuggestionsForType(classElement.type, optype,
+ _addSuggestionsForType(classElement.type, optype, request.ideOptions,
isFunctionalArgument: isFunctionalArgument);
}
for (InterfaceType type in classElement.allSupertypes) {
- _addSuggestionsForType(type, optype,
+ _addSuggestionsForType(type, optype, request.ideOptions,
isFunctionalArgument: isFunctionalArgument);
}
return suggestions;
@@ -104,31 +105,32 @@ class InheritedReferenceContributor extends DartCompletionContributor
skipChildClass: skipChildClass);
}
- _addSuggestionsForType(InterfaceType type, OpType optype,
+ _addSuggestionsForType(
+ InterfaceType type, OpType optype, IdeOptions ideOptions,
{bool isFunctionalArgument: false}) {
if (!isFunctionalArgument) {
for (PropertyAccessorElement elem in type.accessors) {
if (elem.isGetter) {
if (optype.includeReturnValueSuggestions) {
- addSuggestion(elem);
+ addSuggestion(elem, ideOptions);
}
} else {
if (optype.includeVoidReturnSuggestions) {
- addSuggestion(elem);
+ addSuggestion(elem, ideOptions);
}
}
}
}
for (MethodElement elem in type.methods) {
if (elem.returnType == null) {
- addSuggestion(elem);
+ addSuggestion(elem, ideOptions);
} else if (!elem.returnType.isVoid) {
if (optype.includeReturnValueSuggestions) {
- addSuggestion(elem);
+ addSuggestion(elem, ideOptions);
}
} else {
if (optype.includeVoidReturnSuggestions) {
- addSuggestion(elem);
+ addSuggestion(elem, ideOptions);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698