Index: pkg/analysis_server/lib/src/services/completion/dart/local_constructor_contributor.dart |
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/local_constructor_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/local_constructor_contributor.dart |
index cef91def59fe749c234320863e08cedbf8f2a426..ad8e2b4f9d65bf13e177c5d0fdb21ffa6d3072b7 100644 |
--- a/pkg/analysis_server/lib/src/services/completion/dart/local_constructor_contributor.dart |
+++ b/pkg/analysis_server/lib/src/services/completion/dart/local_constructor_contributor.dart |
@@ -16,6 +16,7 @@ import 'package:analysis_server/src/services/completion/dart/local_declaration_v |
import 'package:analysis_server/src/services/completion/dart/optype.dart'; |
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.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'; |
@@ -248,8 +249,10 @@ class _Visitor extends LocalDeclarationVisitor { |
String completion = classDecl.name.name; |
SimpleIdentifier elemId; |
+ ClassElement classElement = |
+ resolutionMap.elementDeclaredByClassDeclaration(classDecl); |
int relevance = optype.constructorSuggestionsFilter( |
- classDecl.element?.type, DART_RELEVANCE_DEFAULT); |
+ classElement?.type, DART_RELEVANCE_DEFAULT); |
if (relevance == null) { |
return; |
} |