Index: pkg/analysis_server/test/services/completion/prefixed_element_contributor_test.dart |
diff --git a/pkg/analysis_server/test/services/completion/prefixed_element_contributor_test.dart b/pkg/analysis_server/test/services/completion/prefixed_element_contributor_test.dart |
index 8015d8ffc3379cc2bda0e8162c28e42a38b47e57..7e77a87bb267b74284aad467b796ea74d2312897 100644 |
--- a/pkg/analysis_server/test/services/completion/prefixed_element_contributor_test.dart |
+++ b/pkg/analysis_server/test/services/completion/prefixed_element_contributor_test.dart |
@@ -60,6 +60,19 @@ void f(Derived d) { |
}); |
} |
+ fail_enumConst_deprecated() { |
+ addTestSource('@deprecated enum E { one, two } main() {E.^}'); |
+ return computeFull((bool result) { |
+ assertNotSuggested('E'); |
+ // TODO(danrubel) Investigate why enum suggestion is not marked |
+ // as deprecated if enum ast element is deprecated |
+ assertSuggestEnumConst('one', isDeprecated: true); |
+ assertSuggestEnumConst('two', isDeprecated: true); |
+ assertNotSuggested('index'); |
+ assertSuggestField('values', 'List<E>', isDeprecated: true); |
+ }); |
+ } |
+ |
fail_test_PrefixedIdentifier_trailingStmt_const_untyped() { |
// SimpleIdentifier PrefixedIdentifier ExpressionStatement |
addTestSource('const g = "hello"; f() {g.^ int y = 0;}'); |
@@ -74,6 +87,72 @@ void f(Derived d) { |
contributor = new PrefixedElementContributor(); |
} |
+ test_enumConst() { |
+ addTestSource('enum E { one, two } main() {E.^}'); |
+ return computeFull((bool result) { |
+ assertNotSuggested('E'); |
+ assertSuggestEnumConst('one'); |
+ assertSuggestEnumConst('two'); |
+ assertNotSuggested('index'); |
+ assertSuggestField('values', 'List<E>'); |
+ }); |
+ } |
+ |
+ test_enumConst2() { |
+ addTestSource('enum E { one, two } main() {E.o^}'); |
+ return computeFull((bool result) { |
+ assertNotSuggested('E'); |
+ assertSuggestEnumConst('one'); |
+ assertSuggestEnumConst('two'); |
+ assertNotSuggested('index'); |
+ assertSuggestField('values', 'List<E>'); |
+ }); |
+ } |
+ |
+ test_enumConst3() { |
+ addTestSource('enum E { one, two } main() {E.^ int g;}'); |
+ return computeFull((bool result) { |
+ assertNotSuggested('E'); |
+ assertSuggestEnumConst('one'); |
+ assertSuggestEnumConst('two'); |
+ assertNotSuggested('index'); |
+ assertSuggestField('values', 'List<E>'); |
+ }); |
+ } |
+ |
+ test_enumConst_index() { |
+ addTestSource('enum E { one, two } main() {E.one.^}'); |
+ return computeFull((bool result) { |
+ assertNotSuggested('E'); |
+ assertNotSuggested('one'); |
+ assertNotSuggested('two'); |
+ assertSuggestField('index', 'int'); |
+ assertNotSuggested('values'); |
+ }); |
+ } |
+ |
+ test_enumConst_index2() { |
+ addTestSource('enum E { one, two } main() {E.one.i^}'); |
+ return computeFull((bool result) { |
+ assertNotSuggested('E'); |
+ assertNotSuggested('one'); |
+ assertNotSuggested('two'); |
+ assertSuggestField('index', 'int'); |
+ assertNotSuggested('values'); |
+ }); |
+ } |
+ |
+ test_enumConst_index3() { |
+ addTestSource('enum E { one, two } main() {E.one.^ int g;}'); |
+ return computeFull((bool result) { |
+ assertNotSuggested('E'); |
+ assertNotSuggested('one'); |
+ assertNotSuggested('two'); |
+ assertSuggestField('index', 'int'); |
+ assertNotSuggested('values'); |
+ }); |
+ } |
+ |
test_generic_field() { |
addTestSource(''' |
class C<T> { |