Chromium Code Reviews| Index: pkg/analysis_server/test/services/completion/completion_test_util.dart |
| diff --git a/pkg/analysis_server/test/services/completion/completion_test_util.dart b/pkg/analysis_server/test/services/completion/completion_test_util.dart |
| index 10d6020e6290ce88b1bb491fba0060ed42aff17a..326899cf1c3ac2382db1dca8fbbab1207d040ea1 100644 |
| --- a/pkg/analysis_server/test/services/completion/completion_test_util.dart |
| +++ b/pkg/analysis_server/test/services/completion/completion_test_util.dart |
| @@ -1026,8 +1026,9 @@ abstract class AbstractSelectorSuggestionTest extends AbstractCompletionTest { |
| assertSuggestImportedClass('C'); |
| // hidden element suggested as low relevance |
| // but imported results are partially filtered |
| - //assertSuggestImportedClass('D', CompletionRelevance.LOW); |
| - //assertSuggestImportedFunction('D1', null, true, CompletionRelevance.LOW); |
| + //assertSuggestImportedClass('D', CompletionRelevance.LOW) |
|
Paul Berry
2014/12/15 16:27:30
Was the semicolon removed by mistake?
danrubel
2014/12/15 17:18:30
Yes. Will add back in following CL
|
| + //assertSuggestImportedFunction( |
| + // 'D1', null, true, CompletionRelevance.LOW); |
| assertSuggestLocalFunction('D2', 'Z'); |
| assertSuggestImportedClass('EE'); |
| // hidden element suggested as low relevance |
| @@ -1422,6 +1423,45 @@ abstract class AbstractSelectorSuggestionTest extends AbstractCompletionTest { |
| }); |
| } |
| + test_ConstructorName_importedFactory() { |
| + // SimpleIdentifier PrefixedIdentifier TypeName ConstructorName |
| + // InstanceCreationExpression |
| + addSource('/testB.dart', ''' |
| + lib B; |
| + int T1; |
| + F1() { } |
| + class X {factory X.c(); factory X._d(); z() {}}'''); |
| + addTestSource(''' |
| + import "/testB.dart"; |
| + var m; |
| + main() {new X.^}'''); |
| + computeFast(); |
| + return computeFull((bool result) { |
| + assertSuggestNamedConstructor('c', 'X'); |
| + assertNotSuggested('F1'); |
| + assertNotSuggested('T1'); |
| + assertNotSuggested('_d'); |
| + assertNotSuggested('z'); |
| + assertNotSuggested('m'); |
| + }); |
| + } |
| + |
| + test_ConstructorName_importedFactory2() { |
| + // SimpleIdentifier PrefixedIdentifier TypeName ConstructorName |
| + // InstanceCreationExpression |
| + addTestSource(''' |
| + main() {new String.fr^omCharCodes([]);}'''); |
| + computeFast(); |
| + return computeFull((bool result) { |
| + assertSuggestNamedConstructor('fromCharCodes', 'String'); |
| + assertNotSuggested('isEmpty'); |
| + assertNotSuggested('isNotEmpty'); |
| + assertNotSuggested('length'); |
| + assertNotSuggested('Object'); |
| + assertNotSuggested('String'); |
| + }); |
| + } |
| + |
| test_ConstructorName_localClass() { |
| // SimpleIdentifier PrefixedIdentifier TypeName ConstructorName |
| // InstanceCreationExpression |
| @@ -1441,6 +1481,25 @@ abstract class AbstractSelectorSuggestionTest extends AbstractCompletionTest { |
| }); |
| } |
| + test_ConstructorName_localFactory() { |
| + // SimpleIdentifier PrefixedIdentifier TypeName ConstructorName |
| + // InstanceCreationExpression |
| + addTestSource(''' |
| + int T1; |
| + F1() { } |
| + class X {factory X.c(); factory X._d(); z() {}} |
| + main() {new X.^}'''); |
| + computeFast(); |
| + return computeFull((bool result) { |
| + assertSuggestNamedConstructor('c', 'X'); |
| + assertSuggestNamedConstructor('_d', 'X'); |
| + assertNotSuggested('F1'); |
| + assertNotSuggested('T1'); |
| + assertNotSuggested('z'); |
| + assertNotSuggested('m'); |
| + }); |
| + } |
| + |
| test_ExpressionStatement_identifier() { |
| // SimpleIdentifier ExpressionStatement Block |
| addSource('/testA.dart', ''' |