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

Unified Diff: pkg/analysis_server/test/domain_completion_test.dart

Issue 2671533002: complete named params in constructors (Closed)
Patch Set: merge 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/test/domain_completion_test.dart
diff --git a/pkg/analysis_server/test/domain_completion_test.dart b/pkg/analysis_server/test/domain_completion_test.dart
index b3d85f2f87af8fc236d002b7c8bb7667fb65af04..87b98c9c372df8c5b9fbc3260acfff95e38ac42a 100644
--- a/pkg/analysis_server/test/domain_completion_test.dart
+++ b/pkg/analysis_server/test/domain_completion_test.dart
@@ -28,6 +28,28 @@ main() {
@reflectiveTest
class CompletionDomainHandlerTest extends AbstractCompletionDomainTest {
+ test_ArgumentList_constructor_named_param_label() async {
+ addTestFile('main() { new A(^);}'
+ 'class A { A({one, two}) {} }');
+ await getSuggestions();
+ assertHasResult(CompletionSuggestionKind.NAMED_ARGUMENT, 'one: ',
+ relevance: DART_RELEVANCE_NAMED_PARAMETER);
+ assertHasResult(CompletionSuggestionKind.NAMED_ARGUMENT, 'two: ',
+ relevance: DART_RELEVANCE_NAMED_PARAMETER);
+ expect(suggestions, hasLength(2));
+ }
+
+ test_ArgumentList_factory_named_param_label() async {
+ addTestFile('main() { new A(^);}'
+ 'class A { factory A({one, two}) => null; }');
+ await getSuggestions();
+ assertHasResult(CompletionSuggestionKind.NAMED_ARGUMENT, 'one: ',
+ relevance: DART_RELEVANCE_NAMED_PARAMETER);
+ assertHasResult(CompletionSuggestionKind.NAMED_ARGUMENT, 'two: ',
+ relevance: DART_RELEVANCE_NAMED_PARAMETER);
+ expect(suggestions, hasLength(2));
+ }
+
test_ArgumentList_imported_function_named_param() async {
addTestFile('main() { int.parse("16", ^);}');
await getSuggestions();

Powered by Google App Engine
This is Rietveld 408576698