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

Unified Diff: pkg/analysis_server/test/services/completion/dart/imported_reference_contributor_test.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/test/services/completion/dart/imported_reference_contributor_test.dart
diff --git a/pkg/analysis_server/test/services/completion/dart/imported_reference_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/imported_reference_contributor_test.dart
index 94a5c564da57c8d42831fa4ec30054b7f3a3d328..33601f7e27831c9a420f92ef6ab787f7425bc8e4 100644
--- a/pkg/analysis_server/test/services/completion/dart/imported_reference_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/imported_reference_contributor_test.dart
@@ -6,6 +6,7 @@ library test.services.completion.contributor.dart.imported_ref;
import 'package:analysis_server/plugin/protocol/protocol.dart'
hide Element, ElementKind;
+import 'package:analysis_server/src/ide_options.dart';
import 'package:analysis_server/src/protocol_server.dart';
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
import 'package:analysis_server/src/services/completion/dart/imported_reference_contributor.dart';
@@ -15,6 +16,7 @@ import 'package:analyzer/src/generated/source.dart';
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
+import '../../correction/flutter_util.dart';
import 'completion_contributor_util.dart';
main() {
@@ -4514,12 +4516,31 @@ class B extends A {
@reflectiveTest
class ImportedReferenceContributorTest_Driver
extends ImportedReferenceContributorTest {
+ final IdeOptions generateChildrenBoilerPlate = new IdeOptionsImpl()
+ ..generateFlutterWidgetChildrenBoilerPlate = true;
+
@override
bool get enableNewAnalysisDriver => true;
- @override
- test_enum_deprecated() {
- // TODO(scheglov) remove it?
+ test_ArgDefaults_Flutter_cons_with_children() async {
+ addMetaPackageSource();
+
+ configureFlutterPkg({
+ 'src/widgets/framework.dart': flutter_framework_code,
+ });
+
+ addTestSource('''
+import 'package:flutter/src/widgets/framework.dart';
+
+build() => new Container(
+ child: new Row^
+ );
+''');
+
+ await computeSuggestions(options: generateChildrenBoilerPlate);
+
+ assertSuggestConstructor("Row",
+ defaultArgListString: "children: <Widget>[]");
}
/// Sanity check. Permutations tested in local_ref_contributor.
@@ -4544,4 +4565,9 @@ void main() {f^}''');
assertSuggestFunction('foo', 'bool',
defaultArgListString: 'bar, baz: null');
}
+
+ @override
+ test_enum_deprecated() {
+ // TODO(scheglov) remove it?
+ }
}

Powered by Google App Engine
This is Rietveld 408576698