Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add @class annotations for the various setup() option tables #1330

Closed
2 tasks done
tristan957 opened this issue Nov 8, 2024 · 2 comments
Closed
2 tasks done

Add @class annotations for the various setup() option tables #1330

tristan957 opened this issue Nov 8, 2024 · 2 comments
Labels
ALL This is related to all present modules documentation Improvements or additions to documentation feature-request Request for a feature to existing module

Comments

@tristan957
Copy link

Contributing guidelines

Module(s)

all

Description

It would be awesome if all the mini plugins could provide @class annotations, so we could all make our configs a little bit more type-safe.

My use case right now is:

---@type LazySpec
return {
  "echasnovski/mini.diff",
  ---@type MiniDiff.Config
  opts = {
  },
}
@tristan957 tristan957 added the feature-request Request for a feature to existing module label Nov 8, 2024
@echasnovski echasnovski added documentation Improvements or additions to documentation ALL This is related to all present modules labels Nov 8, 2024
@echasnovski
Copy link
Owner

Thanks for the suggestion!

At the moment I don't support the decision to add LuaLS-EmmyLua-LuaCATS annotations to 'mini.nvim'. Mostly because it will add too much boilerplate lines which will duplicate already existing documentation.

One possible more or less bearable solution to this is to have a whole separate 'lua/mini/_meta/' directory with each module having its own file with its annotations. It has to be separate files to work nicely with dual distribution. Main big issue here is that it will not only significantly increase maintenance burden but also will separate code from its documentation (which I generally don't like).

I think I'll close this for now. If (a very big if) there will be work for adding class type annotations, it will be more general with all data structures used in 'mini.nvim'.

@tristan957
Copy link
Author

Sounds good, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ALL This is related to all present modules documentation Improvements or additions to documentation feature-request Request for a feature to existing module
Projects
None yet
Development

No branches or pull requests

2 participants