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

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

Issue 1514603002: suggest after import prefix in part files - fixes #25023 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge 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
« no previous file with comments | « pkg/analysis_server/test/services/completion/dart/completion_contributor_util.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/library_member_contributor_test.dart
diff --git a/pkg/analysis_server/test/services/completion/dart/library_member_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/library_member_contributor_test.dart
index 057fd7ff43d5840dce1d43c73171e2cb9d17b296..1f6b66e699a361ede5cb517fb8991c90367b1ce5 100644
--- a/pkg/analysis_server/test/services/completion/dart/library_member_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/library_member_contributor_test.dart
@@ -55,6 +55,23 @@ class LibraryMemberContributorTest extends DartCompletionContributorTest {
assertSuggestFunction('loadLibrary', 'Future<dynamic>');
}
+ test_libraryPrefix_deferred_inPart() async {
+ // SimpleIdentifier PrefixedIdentifier ExpressionStatement
+ var libFile = '${testFile.substring(0, testFile.length - 5)}A.dart';
+ addSource(
+ libFile,
+ '''
+ library testA;
+ import "dart:async" deferred as bar;
+ part "$testFile";''');
+ addTestSource('part of testA; foo() {bar.^}');
+ // Assume that libraries containing has been computed for part files
+ await computeLibrariesContaining();
+ await computeSuggestions();
+ assertSuggestClass('Future');
+ assertSuggestFunction('loadLibrary', 'Future<dynamic>');
+ }
+
test_libraryPrefix_with_exports() async {
addSource('/libA.dart', 'library libA; class A { }');
addSource('/libB.dart', 'library libB; export "/libA.dart"; class B { }');
@@ -91,6 +108,42 @@ class LibraryMemberContributorTest extends DartCompletionContributorTest {
assertNotSuggested('==');
}
+ test_PrefixedIdentifier_library_inPart() async {
+ // SimpleIdentifier PrefixedIdentifier ExpressionStatement
+ var libFile = '${testFile.substring(0, testFile.length - 5)}A.dart';
+ addSource(
+ '/testB.dart',
+ '''
+ lib B;
+ var T1;
+ class X { }
+ class Y { }''');
+ addSource(
+ libFile,
+ '''
+ library testA;
+ import "/testB.dart" as b;
+ part "$testFile";
+ var T2;
+ class A { }''');
+ addTestSource('''
+ part of testA;
+ main() {b.^}''');
+ // Assume that libraries containing has been computed for part files
+ await computeLibrariesContaining();
+ await computeSuggestions();
+ expect(replacementOffset, completionOffset);
+ expect(replacementLength, 0);
+ assertSuggestClass('X');
+ assertSuggestClass('Y');
+ assertSuggestTopLevelVar('T1', null);
+ assertNotSuggested('T2');
+ assertNotSuggested('Object');
+ assertNotSuggested('b');
+ assertNotSuggested('A');
+ assertNotSuggested('==');
+ }
+
test_PrefixedIdentifier_library_typesOnly() async {
// SimpleIdentifier PrefixedIdentifier TypeName
addSource(
« no previous file with comments | « pkg/analysis_server/test/services/completion/dart/completion_contributor_util.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698