Skip to content

Ability to inline class definition in generated docs #20

@mfussenegger

Description

@mfussenegger

First of all thanks for the great tool. Some of my plugins still wouldn't have a API reference documentation without it :)

In lua it is common to use a opts table as parameter to mirror keyword arguments. One can document those via @param opts table|nil [comment] but with lua-language-server it's more useful to introduce some kind of class to have better code assistance:

@class OptsForFunctionXY
@field foo string

...


@param opts OptsForFunctionXY|nil

This ends up cluttering the documentation a bit and results in lots of additional tags. See https://github.com/mfussenegger/nvim-jdtls/pull/290/files for an example.

It would be nice if it were possible to inline the options. Instead of:

M.build_projects({opts})                                  *jdtls.build_projects*
     Trigger a rebuild of one or more projects.



    Parameters: ~
        {opts}  (JdtBuildProjectOpts|nil)  optional configuration options


JdtBuildProjectOpts                                        *JdtBuildProjectOpts*


    Fields: ~
        {select_mode}  (JdtProjectSelectMode)  Show prompt to select projects or select all. Defaults to "prompt"
        {full_build}   (boolean)               full rebuild or incremental build. Defaults to true (full build)

It would generate something like this:

M.build_projects({opts})                                  *jdtls.build_projects*
     Trigger a rebuild of one or more projects.



    Parameters: ~
        {opts}  (table|nil)  optional configuration options:
                               * select_mode: (JdtProjectSelectMode) Show prompt
                                  to select projects or select all. Defaults
                                  to "prompt"
                               * full_build: (boolean) full rebuild or
                                  incremental build. Defaults to true (full build)

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions