visitTopLevelFunctionElement method
Visits a top-level function element and extracts its documentation.
Implementation
@override
void visitTopLevelFunctionElement(TopLevelFunctionElement element) {
components.add(
DocComponent(
name: element.name!,
filePath: filePath,
description: _getDescription(element),
constructors: [],
properties: [],
methods: [
DocMethod(
name: element.name!,
returnType: _getDocType(element.returnType),
description: _getDescription(element),
signature: _mapParameters(element.formalParameters),
features: [if (element.isStatic) "static", if (element.isExternal) "external"],
annotations: _getAnnotations(element),
typeParameters: _getTypeParameters(element.typeParameters),
),
],
type: DocComponentType.functionType,
annotations: _getAnnotations(element),
typeParameters: _getTypeParameters(element.typeParameters),
),
);
super.visitTopLevelFunctionElement(element);
}