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

Unified Diff: pkg/analysis_server/test/services/completion/dart/arglist_contributor_test.dart

Issue 2683233002: Include the field documentation for named field formal parameter completion suggestions. (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/dart/arglist_contributor.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/services/completion/dart/arglist_contributor_test.dart
diff --git a/pkg/analysis_server/test/services/completion/dart/arglist_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/arglist_contributor_test.dart
index 6332eebde90d0a4f6823e7fef53cc16d8cf0bf5c..d534e1dab3f8e806ccd5eb69d4aafe65a12cabee 100644
--- a/pkg/analysis_server/test/services/completion/dart/arglist_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/arglist_contributor_test.dart
@@ -256,7 +256,8 @@ class A { const A(int one, int two, int three, {int four, String five:
test_ArgumentList_imported_factory_named_param() async {
// ArgumentList InstanceCreationExpression ExpressionStatement
- addSource('/libA.dart', 'library libA; class A{factory A({int one}) => null;}');
+ addSource(
+ '/libA.dart', 'library libA; class A{factory A({int one}) => null;}');
addTestSource('import "/libA.dart"; main() { new A(^);}');
await computeSuggestions();
assertSuggestArgumentsAndTypes(namedArgumentsWithTypes: {'one': 'int'});
@@ -264,7 +265,8 @@ class A { const A(int one, int two, int three, {int four, String five:
test_ArgumentList_imported_factory_named_param2() async {
// ArgumentList InstanceCreationExpression ExpressionStatement
- addSource('/libA.dart', 'library libA; abstract class A{factory A.foo({int one});}');
+ addSource('/libA.dart',
+ 'library libA; abstract class A{factory A.foo({int one});}');
addTestSource('import "/libA.dart"; main() { new A.foo(^);}');
await computeSuggestions();
assertSuggestArgumentsAndTypes(namedArgumentsWithTypes: {'one': 'int'});
@@ -479,6 +481,40 @@ class A { const A(int one, int two, int three, {int four, String five:
namedArgumentsWithTypes: {'radix': 'int', 'onError': '(String) → int'});
}
+ test_ArgumentList_local_constructor_named_fieldFormal_documentation() async {
+ addTestSource('''
+class A {
+ /// aaa
+ ///
+ /// bbb
+ /// ccc
+ int fff;
+A({this.fff}) { } }
+main() {
+ new A(^);
+}
+''');
+ await computeSuggestions();
+ expect(suggestions, hasLength(1));
+ expect(suggestions[0].docSummary, 'aaa');
+ expect(suggestions[0].docComplete, 'aaa\n\nbbb\nccc');
+ }
+
+ test_ArgumentList_local_constructor_named_fieldFormal_noDocumentation() async {
+ addTestSource('''
+class A {
+ int fff;
+A({this.fff}) { } }
+main() {
+ new A(^);
+}
+''');
+ await computeSuggestions();
+ expect(suggestions, hasLength(1));
+ expect(suggestions[0].docSummary, isNull);
+ expect(suggestions[0].docComplete, isNull);
+ }
+
test_ArgumentList_local_constructor_named_param() async {
//
addTestSource('''
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/dart/arglist_contributor.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698