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

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

Issue 2728653004: Default arg support continued (flutter-intellij#553). (Closed)
Patch Set: Review tweaks. 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
Index: pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart
diff --git a/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart
index 15b37b29dc1222f2b9e75f5372ccfc2b725c3040..2d9156a4375fff35d5717458b886b9929d690dcb 100644
--- a/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart
@@ -4620,7 +4620,7 @@ void main() {h^}''');
}
test_ArgDefaults_function_with_optional_positional() async {
- _addMetaPackageSource();
+ addMetaPackageSource();
addTestSource('''
import 'package:meta/meta.dart';
@@ -4633,7 +4633,7 @@ void main() {h^}''');
}
test_ArgDefaults_function_with_required_named() async {
- _addMetaPackageSource();
+ addMetaPackageSource();
addTestSource('''
import 'package:meta/meta.dart';
@@ -4646,19 +4646,21 @@ void main() {h^}''');
defaultArgListString: 'bar, baz: null');
}
- void _addMetaPackageSource() {
- addPackageSource(
- 'meta',
- 'meta.dart',
- r'''
-library meta;
+ test_ArgDefaults_method_with_required_named() async {
+ addMetaPackageSource();
+ addTestSource('''
+import 'package:meta/meta.dart';
-const Required required = const Required();
+class A {
+ bool foo(int bar, {bool boo, @required int baz}) => false;
+ baz() {
+ f^
+ }
+}''');
+ await computeSuggestions();
-class Required {
- final String reason;
- const Required([this.reason]);
-}
-''');
+ assertSuggestMethod('foo', 'A', 'bool',
+ relevance: DART_RELEVANCE_LOCAL_METHOD,
+ defaultArgListString: 'bar, baz: null');
}
}

Powered by Google App Engine
This is Rietveld 408576698