convertElement method

Element convertElement(
  1. Element element
)

Convert the given element from the 'analyzer' package to an element defined by the plugin API.

Implementation

plugin.Element convertElement(analyzer.Element element) {
  var kind = _convertElementToElementKind(element);
  return plugin.Element(
    kind,
    element.displayName,
    plugin.Element.makeFlags(
      isPrivate: element.isPrivate,
      isDeprecated: element.hasDeprecated,
      isAbstract: _isAbstract(element),
      isConst: _isConst(element),
      isFinal: _isFinal(element),
      isStatic: _isStatic(element),
    ),
    location: locationFromElement(element),
    typeParameters: _getTypeParametersString(element),
    aliasedType: _getAliasedTypeString(element),
    parameters: _getParametersString(element),
    returnType: _getReturnTypeString(element),
  );
}