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

Unified Diff: pkg/analysis_server/lib/src/services/completion/dart/named_constructor_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/named_constructor_contributor.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/named_constructor_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/named_constructor_contributor.dart
index fdeca379203fe45b3f31be393f5269abadacf29c..e5872cae31bfa026ddee3c90030aaef4f01ea87b 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/named_constructor_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/named_constructor_contributor.dart
@@ -7,6 +7,7 @@ library services.completion.contributor.dart.named_constructor;
import 'dart:async';
import 'package:analysis_server/plugin/protocol/protocol.dart' hide Element;
+import 'package:analysis_server/src/ide_options.dart';
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analyzer/dart/ast/ast.dart';
@@ -56,7 +57,7 @@ class NamedConstructorContributor extends DartCompletionContributor {
if (type != null) {
Element classElem = type.element;
if (classElem is ClassElement) {
- return _buildSuggestions(libElem, classElem);
+ return _buildSuggestions(libElem, classElem, request.ideOptions);
}
}
}
@@ -65,14 +66,15 @@ class NamedConstructorContributor extends DartCompletionContributor {
}
List<CompletionSuggestion> _buildSuggestions(
- LibraryElement libElem, ClassElement classElem) {
+ LibraryElement libElem, ClassElement classElem, IdeOptions options) {
bool isLocalClassDecl = classElem.library == libElem;
List<CompletionSuggestion> suggestions = <CompletionSuggestion>[];
for (ConstructorElement elem in classElem.constructors) {
if (isLocalClassDecl || !elem.isPrivate) {
String name = elem.name;
if (name != null) {
- CompletionSuggestion s = createSuggestion(elem, completion: name);
+ CompletionSuggestion s =
+ createSuggestion(elem, options, completion: name);
if (s != null) {
suggestions.add(s);
}

Powered by Google App Engine
This is Rietveld 408576698