getNodeTypeName function
Get a human-readable short name for the kind of node
Implementation
String getNodeTypeName(Node node) {
if (node is DocNode) {
if (node.kind == "typeAlias") {
return "Type";
}
final kind = node.kind;
return "${kind[0].toUpperCase()}${kind.substring(1)}";
}
// Fallback for Property/Method definitions which don't have 'kind' field in the same way as DocNode
// Actually InterfaceMethodDef has kind "method"|"getter"|"setter".
// InterfacePropertyDef doesn't have kind.
return "Property";
}