Index: pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart |
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart |
index 01298f865156ee5ce6a744c93b2412730ddbbb20..2d3bdd1fcfce69223dcbc2c192770ea70fad638d 100644 |
--- a/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart |
+++ b/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart |
@@ -17,6 +17,7 @@ import 'package:analysis_server/src/services/completion/dart/optype.dart'; |
import 'package:analysis_server/src/services/correction/strings.dart'; |
import 'package:analysis_server/src/utilities/documentation.dart'; |
import 'package:analyzer/dart/ast/ast.dart'; |
+import 'package:analyzer/dart/ast/standard_resolution_map.dart'; |
import 'package:analyzer/dart/ast/standard_ast_factory.dart'; |
import 'package:analyzer/dart/ast/token.dart'; |
import 'package:analyzer/dart/element/element.dart'; |
@@ -520,8 +521,10 @@ class _LocalVisitor extends LocalDeclarationVisitor { |
{bool isAbstract: false, |
bool isDeprecated: false, |
int relevance: DART_RELEVANCE_DEFAULT}) { |
- relevance = optype.returnValueSuggestionsFilter( |
- enumDeclaration.element?.type, relevance); |
+ ClassElement classElement = |
+ resolutionMap.elementDeclaredByEnumDeclaration(enumDeclaration); |
+ relevance = |
+ optype.returnValueSuggestionsFilter(classElement?.type, relevance); |
if (relevance != null) { |
_addLocalSuggestion_enumConstant(constantDeclaration, enumDeclaration, |
isAbstract: isAbstract, |