uniffi-rs icon indicating copy to clipboard operation
uniffi-rs copied to clipboard

Improve use of fields' docstrings

Open ptitjes opened this issue 1 year ago • 0 comments

Every field of records, associated enums and associated errors can have an attached docstring (at least using proc-macros).

Currently they are rendered like this:

/**
 * <docstring-record>
 */
data class RecordTest (
    /**
     * <docstring-record-field>
     */
    var `test`: Int
) {
    
    companion object
}

It is not useful as they will not be caught by tooling. They should be really rendered like this:

/**
 * <docstring-record>
 *
 * @param test <docstring-record-field>
 */
data class RecordTest (
    var `test`: Int
) {
    
    companion object
}

I believe what is generated for Python is OK, but I don't know how we are supposed to document these in Swift.

ptitjes avatar Nov 27 '23 19:11 ptitjes