Skip to content

Update mini.doc to LuaCATS #666

Open
@S1M0N38

Description

@S1M0N38

Contributing guidelines

Module(s)

mini.doc

Description

LuaLS/lua-language-server is the most used implementation Language server for Lua. One of its features are annotations implemented as LuaCATS (Lua Comment And Type System). As stated in their docs:

LuaCATS annotations are no longer cross-compatible with EmmyLua annotations as of v3

The current implementation of mini.doc try to parse EmmyLua-like annotations. Compare to EmmyLua annoation, LuaCATS define a precise specification for annotation.

For instance, the mini.doc :help section mentions:

Hooks for sections which supposed to have "type-like" data ('@field',
'@param', '@return', '@type') automatically enclose first found
"type-like" word and its neighbor characters in '(<type>)' (expect
false positives). Algorithm is far from being 100% correct ...

Conversely, the @param annotation supported by LuaLS/lua-language-server is explicitly defined as:

---@param <name[?]> <type[|type...]> [description]

In this format, the type directly follows the parameter name, eliminating the need for heuristic searches for the type. Additionally, this format simplifies the integration of user-defined types into help.txt.


While I could develop my own hooks to adhere to the LuaCATS specification (skill permitting), I believe that aligning with a dominant and well-documented standard would be more advantageous for the community.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions