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

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

Issue 1507303002: extract LibraryMemberContributor from prefixed element contributor (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 888b7ccf911ace21c6ed41cd88ad38f2b3b14f31..184ebef9cbfe58437ef759b8ac329532a9574e19 100644
--- a/pkg/analysis_server/test/domain_completion_test.dart
+++ b/pkg/analysis_server/test/domain_completion_test.dart
@@ -470,6 +470,19 @@ class CompletionTest extends AbstractAnalysisTest {
});
}
+ test_imports_prefixed2() {
+ addTestFile('''
+ import 'dart:html' as foo;
+ main() {foo.^}
+ ''');
+ return getSuggestions().then((_) {
+ expect(replacementOffset, equals(completionOffset));
+ expect(replacementLength, equals(0));
+ assertHasResult(CompletionSuggestionKind.INVOCATION, 'HtmlElement');
+ assertNoResult('test');
+ });
+ }
+
test_invocation() {
addTestFile('class A {b() {}} main() {A a; a.^}');
return getSuggestions().then((_) {
@@ -632,6 +645,16 @@ class B extends A {m() {^}}
});
}
+ test_static() {
+ addTestFile('class A {static b() {} c() {}} main() {A.^}');
+ return getSuggestions().then((_) {
+ expect(replacementOffset, equals(completionOffset));
+ expect(replacementLength, equals(0));
+ assertHasResult(CompletionSuggestionKind.INVOCATION, 'b');
+ assertNoResult('c');
+ });
+ }
+
test_topLevel() {
addTestFile('''
typedef foo();

Powered by Google App Engine
This is Rietveld 408576698