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

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

Issue 629633002: suggest re-exported elements of imported libraries (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years, 2 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/test/services/completion/completion_test_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/imported_computer_test.dart
diff --git a/pkg/analysis_server/test/services/completion/imported_computer_test.dart b/pkg/analysis_server/test/services/completion/imported_computer_test.dart
index b6ff16dcc4f7b5a4c3194524cece0a357d8d7f33..f5cdf45dfd607f98c7bf650db7be36fb74326946 100644
--- a/pkg/analysis_server/test/services/completion/imported_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/imported_computer_test.dart
@@ -50,9 +50,11 @@ class ImportedTypeComputerTest extends AbstractCompletionTest {
assertNotSuggested('x');
assertNotSuggested('_B');
assertSuggestClass('C');
- assertNotSuggested('D');
+ // hidden element suggested as low relevance
+ assertSuggestClass('D', CompletionRelevance.LOW);
assertSuggestClass('EE');
- assertNotSuggested('F');
+ // hidden element suggested as low relevance
+ assertSuggestClass('F', CompletionRelevance.LOW);
assertSuggestLibraryPrefix('g');
assertNotSuggested('G');
assertSuggestClass('H', CompletionRelevance.LOW);
@@ -65,9 +67,23 @@ class ImportedTypeComputerTest extends AbstractCompletionTest {
});
}
+ test_PrefixedIdentifier() {
+ // SimpleIdentifier PrefixedIdentifier ExpressionStatement
+ addTestSource('''
+ class A {var b; X _c;}
+ class X{}
+ main() {A a; a.^}''');
+ return computeFull(true).then((_) {
+ // PrefixedIdentifier is handled by InvocationComputer
+ assertNotSuggested('b');
+ assertNotSuggested('_c');
+ assertNotSuggested('Object');
+ });
+ }
+
test_Block_function() {
addSource('/testA.dart', '''
- export "dart:math" hide sin;
+ export "dart:math" hide max;
@deprecated A() {int x;}
_B() {}''');
addTestSource('''
@@ -77,10 +93,8 @@ class ImportedTypeComputerTest extends AbstractCompletionTest {
assertSuggestFunction('A', null, true);
assertNotSuggested('x');
assertNotSuggested('_B');
- // TODO (danrubel) should suggest exported elements from imported lib
- //assertSuggestFunction('cos', 'num', false);
- assertNotSuggested('cos');
- assertNotSuggested('sin');
+ assertSuggestFunction('min', 'num', false);
+ assertSuggestFunction('max', 'num', false, CompletionRelevance.LOW);
// Should not suggest compilation unit elements
// which are returned by the LocalComputer
assertNotSuggested('X');
@@ -100,7 +114,7 @@ class ImportedTypeComputerTest extends AbstractCompletionTest {
class C {foo(){^}}''');
// pass true for full analysis to pick up unimported source
return computeFull(true).then((_) {
- assertSuggestTopLevelVar('T1', 'String');
+ assertSuggestTopLevelVarGetterSetter('T1', 'String');
assertNotSuggested('_T2');
assertSuggestTopLevelVar('T3', 'int', CompletionRelevance.LOW);
assertNotSuggested('_T4');
« no previous file with comments | « pkg/analysis_server/test/services/completion/completion_test_util.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698