echasnovski / mini.nvim

Library of 40+ independent Lua modules improving overall Neovim (version 0.8 and higher) experience with minimal effort
MIT License
4.54k stars 175 forks source link

docs(icons): update `get` documentation to document all return values #1027

Closed mehalter closed 1 week ago

mehalter commented 1 week ago

The documentation strings should follow the LuaCATS standard for the most part which documents multiple returns with multiple @return comments.

Relevant links:

Currently this results in documentation generated with multiple Return headers. I believe this is intended since this is a case explicitly tested in the mini.doc test suite. If we want to move this to behave more like Parameters that could also be nice and more clear to the user. I have this change working in a separate branch. I could add that to this PR if desired or follow up with a separate PR. There would also need to be some amount of discussion or thought of whether or not to stick with the word "Return" for the section header here or move to "Returns" since similarly to "Parameters" and "Fields", there can be many.

I know that these documentation strings are more meant to align with mini.doc rather than the standard LuaCATS right now and it may be a goal to move to supporting the standard in the future (#666). So the strings here still aren't "true" LuaCATS since they don't have names for the returns or the # indicating it's a labelled return. So let me know if this is just out of scope for the time being and will be implemented correctly later when the open issue about LuaCATS is resolved.

Let me know what you think and I can update my PR as necessary to align with the project's goals. Glad to help in any way I can 😄

echasnovski commented 1 week ago

Thanks for the PR!

I know that these documentation strings are more meant to align with mini.doc rather than the standard LuaCATS right now and it may be a goal to move to supporting the standard in the future (#666). So the strings here still aren't "true" LuaCATS since they don't have names for the returns or the # indicating it's a labelled return. So let me know if this is just out of scope for the time being and will be implemented correctly later when the open issue about LuaCATS is resolved.

Yes, I am afraid this is out of scope for the time being. I hope to eventually get back to this during #666. Nevertheless, information you linked in first comment will be useful. Thanks!

Closing as "planned but not now".

mehalter commented 1 week ago

Ok cool thanks! It's just a shame this is now the one function in mini.nvim that is not compatible with the Lua language server at all. I'll just disable diagnostics for this module in my code