@@ -6,7 +6,7 @@ import 'package:analysis_server/src/computer/computer_documentation.dart';
66import 'package:analysis_server/src/protocol_server.dart' hide Element;
77import 'package:analysis_server/src/utilities/extensions/ast.dart' ;
88import 'package:analyzer/dart/ast/ast.dart' ;
9- import 'package:analyzer/dart/element/element .dart' ;
9+ import 'package:analyzer/dart/element/element2 .dart' ;
1010import 'package:analyzer/dart/element/type.dart' ;
1111import 'package:analyzer/src/dart/ast/element_locator.dart' ;
1212import 'package:analyzer/src/dart/ast/utilities.dart' ;
@@ -40,33 +40,35 @@ class DartUnitSignatureComputer {
4040 return null ;
4141 }
4242 String ? name;
43- Element ? element;
44- List <ParameterElement >? parameters;
43+ Element2 ? element;
44+ List <FormalParameterElement >? parameters;
4545 var parent = argumentList.parent;
4646 if (parent is MethodInvocation ) {
4747 name = parent.methodName.name;
48- element = ElementLocator .locate (parent);
49- parameters = element is FunctionTypedElement ? element.parameters : null ;
48+ element = ElementLocator .locate2 (parent);
49+ parameters =
50+ element is FunctionTypedElement2 ? element.formalParameters : null ;
5051 } else if (parent is InstanceCreationExpression ) {
5152 name = parent.constructorName.type.qualifiedName;
5253 var constructorName = parent.constructorName.name;
5354 if (constructorName != null ) {
5455 name += '.${constructorName .name }' ;
5556 }
56- element = ElementLocator .locate (parent);
57- parameters = element is FunctionTypedElement ? element.parameters : null ;
57+ element = ElementLocator .locate2 (parent);
58+ parameters =
59+ element is FunctionTypedElement2 ? element.formalParameters : null ;
5860 } else if (parent
5961 case FunctionExpressionInvocation (function: Identifier function)) {
6062 name = function.name;
6163
6264 if (function.staticType case FunctionType functionType) {
6365 // Standard function expression.
64- element = function.staticElement ;
65- parameters = functionType.parameters ;
66- } else if (parent.staticElement case ExecutableElement staticElement ) {
66+ element = function.element ;
67+ parameters = functionType.formalParameters ;
68+ } else if (parent.element case ExecutableElement2 executableElement ) {
6769 // Callable class instance (where we'll look at the `call` method).
68- element = staticElement ;
69- parameters = staticElement.parameters ;
70+ element = executableElement ;
71+ parameters = executableElement.formalParameters ;
7072 }
7173 }
7274
@@ -76,7 +78,7 @@ class DartUnitSignatureComputer {
7678
7779 _argumentList = argumentList;
7880 var convertedParameters = parameters.map ((p) => _convertParam (p)).toList ();
79- var dartdoc = _documentationComputer.computePreferred (
81+ var dartdoc = _documentationComputer.computePreferred2 (
8082 element,
8183 documentationPreference,
8284 );
@@ -88,7 +90,7 @@ class DartUnitSignatureComputer {
8890 );
8991 }
9092
91- ParameterInfo _convertParam (ParameterElement param) {
93+ ParameterInfo _convertParam (FormalParameterElement param) {
9294 return ParameterInfo (
9395 param.isOptionalNamed
9496 ? ParameterKind .OPTIONAL_NAMED
0 commit comments