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

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

Issue 2869653002: add constructor initializer completions (Closed)
Patch Set: Created 3 years, 7 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/local_reference_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/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 dbc295c8a8102a93a3cfda8ced2ba686e86add43..0fd60c6031e7482398c19f714734f39b6b325bc6 100644
--- a/pkg/analysis_server/test/domain_completion_test.dart
+++ b/pkg/analysis_server/test/domain_completion_test.dart
@@ -180,6 +180,60 @@ class CompletionDomainHandlerTest extends AbstractCompletionDomainTest {
expect(suggestions, hasLength(2));
}
+ test_constructor() async {
+ addTestFile('class A {bool foo; A() : ^;}');
+ await getSuggestions();
+ assertHasResult(CompletionSuggestionKind.KEYWORD, 'super',
+ relevance: DART_RELEVANCE_KEYWORD);
+ assertHasResult(CompletionSuggestionKind.INVOCATION, 'foo',
+ relevance: DART_RELEVANCE_LOCAL_FIELD);
+ }
+
+ test_constructor2() async {
+ addTestFile('class A {bool foo; A() : s^;}');
+ await getSuggestions();
+ assertHasResult(CompletionSuggestionKind.KEYWORD, 'super',
+ relevance: DART_RELEVANCE_KEYWORD);
+ assertHasResult(CompletionSuggestionKind.INVOCATION, 'foo',
+ relevance: DART_RELEVANCE_LOCAL_FIELD);
+ }
+
+ test_constructor3() async {
+ addTestFile('class A {bool foo; A() : a=7,^;}');
+ await getSuggestions();
+ assertHasResult(CompletionSuggestionKind.KEYWORD, 'super',
+ relevance: DART_RELEVANCE_KEYWORD);
+ assertHasResult(CompletionSuggestionKind.INVOCATION, 'foo',
+ relevance: DART_RELEVANCE_LOCAL_FIELD);
+ }
+
+ test_constructor4() async {
+ addTestFile('class A {bool foo; A() : a=7,s^;}');
+ await getSuggestions();
+ assertHasResult(CompletionSuggestionKind.KEYWORD, 'super',
+ relevance: DART_RELEVANCE_KEYWORD);
+ assertHasResult(CompletionSuggestionKind.INVOCATION, 'foo',
+ relevance: DART_RELEVANCE_LOCAL_FIELD);
+ }
+
+ test_constructor5() async {
+ addTestFile('class A {bool foo; A() : a=7,s^}');
+ await getSuggestions();
+ assertHasResult(CompletionSuggestionKind.KEYWORD, 'super',
+ relevance: DART_RELEVANCE_KEYWORD);
+ assertHasResult(CompletionSuggestionKind.INVOCATION, 'foo',
+ relevance: DART_RELEVANCE_LOCAL_FIELD);
+ }
+
+ test_constructor6() async {
+ addTestFile('class A {bool foo; A() : a=7,^ void bar() {}}');
+ await getSuggestions();
+ assertHasResult(CompletionSuggestionKind.KEYWORD, 'super',
+ relevance: DART_RELEVANCE_KEYWORD);
+ assertHasResult(CompletionSuggestionKind.INVOCATION, 'foo',
+ relevance: DART_RELEVANCE_LOCAL_FIELD);
+ }
+
@failingTest
test_html() {
//
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698