Skip to content

autodoc: pub const function alias is rendered incorrectly #20905

Open
@squeek502

Description

@squeek502

This could overlap with #19528 and/or #17334, but it is different enough that I'm opening a new issue.

In std.fs.path, there are fmtAsUtf8Lossy and fmtWtf16LeAsUtf8Lossy:

zig/lib/std/fs/path.zig

Lines 1943 to 1956 in 624fa85

/// Format a path encoded as bytes for display as UTF-8.
/// Returns a Formatter for the given path. The path will be converted to valid UTF-8
/// during formatting. This is a lossy conversion if the path contains any ill-formed UTF-8.
/// Ill-formed UTF-8 byte sequences are replaced by the replacement character (U+FFFD)
/// according to "U+FFFD Substitution of Maximal Subparts" from Chapter 3 of
/// the Unicode standard, and as specified by https://encoding.spec.whatwg.org/#utf-8-decoder
pub const fmtAsUtf8Lossy = std.unicode.fmtUtf8;
/// Format a path encoded as WTF-16 LE for display as UTF-8.
/// Return a Formatter for a (potentially ill-formed) UTF-16 LE path.
/// The path will be converted to valid UTF-8 during formatting. This is
/// a lossy conversion if the path contains any unpaired surrogates.
/// Unpaired surrogates are replaced by the replacement character (U+FFFD).
pub const fmtWtf16LeAsUtf8Lossy = std.unicode.fmtUtf16Le;

However, autodoc does not render with those names/doc comments included at all, instead rendering them as fmtUtf8 and fmtUtf16Le:

From https://ziglang.org/documentation/master/std/#std.fs.path

Screenshot from 2024-08-01 15-54-23

I expect the std.fs.path autodoc to have the names and doc comments from std/fs/path.zig.

Metadata

Metadata

Assignees

No one assigned

    Labels

    autodocThe web application for interactive documentation and generation of its assets.bugObserved behavior contradicts documented or intended behavior

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions