Skip to content

feat(doc): generate meta file#763

Merged
squeek502 merged 4 commits into
luvit:masterfrom
lewis6991:feat/metafile
May 4, 2025
Merged

feat(doc): generate meta file#763
squeek502 merged 4 commits into
luvit:masterfrom
lewis6991:feat/metafile

Conversation

@lewis6991
Copy link
Copy Markdown
Contributor

@lewis6991 lewis6991 commented Apr 15, 2025

This file adds additional logic to docgen.lua to generate a file meta.lua which is formatted with LuaCATs.

For complex types, the script will automatically create either a @class or @alias, and will be rendered near to their use.


Note: This PR produces something similar to https://github.com/LuaCATS/luv, but not 100%. The main difference being that this PR generates significantly less @class and @alias names.

@lewis6991

This comment was marked as resolved.

- Move `uv.spawn` `options` description into the param description.
This file adds additional logic to docgen.lua to generate a file
meta.lua which is formatted with LuaCATs.

The complex types, the script will automatically create either a
@Class or @alias, and will be formatted near to there use.
@lewis6991 lewis6991 force-pushed the feat/metafile branch 4 times, most recently from 2a303a9 to 4501268 Compare April 15, 2025 14:32
@lewis6991 lewis6991 marked this pull request as ready for review April 15, 2025 14:52
@clason
Copy link
Copy Markdown

clason commented Apr 20, 2025

Seems to be missing uv.read_start.callback (and friends)?

@lewis6991
Copy link
Copy Markdown
Contributor Author

Yes, I chose not to generate these. For simple types they are inlined.

--- @param stream uv.uv_stream_t
--- @param callback fun(err: string?, data: string?)
--- @return 0? success
--- @return string? err
--- @return string? err_name
function uv.read_start(stream, callback) end

@clason
Copy link
Copy Markdown

clason commented Apr 22, 2025

Ok, but that means these files are not drop-in replacements for https://github.com/LuaCATS/luv, and switching to them requires annotation changes in Neovim (_system.lua, to be precise).

@lewis6991
Copy link
Copy Markdown
Contributor Author

lewis6991 commented Apr 22, 2025

Yes. Providing a 100% drop-replacement for https://github.com/LuaCATS/luv was not my intended goal

@clason
Copy link
Copy Markdown

clason commented Apr 22, 2025

That's fair, but could you then make the goal explicit in the PR description (which I suspect is garbled; the second paragraph doesn't make sense to me)?

@lewis6991
Copy link
Copy Markdown
Contributor Author

I think the current PR description reflects the goal and makes no mention of https://github.com/LuaCATS/luv . However, I've added a note mentioning it is similar but different.

@lewis6991
Copy link
Copy Markdown
Contributor Author

cc @truemedian @squeek502 . Sorry to ping, any chance of a review?

Copy link
Copy Markdown
Member

@squeek502 squeek502 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs.md changes look good, and I'm going to trust that the meta.lua file is useful for the intended use cases as I'm unfamiliar with LuaCATS.

Thanks!

@squeek502 squeek502 merged commit 891ba33 into luvit:master May 4, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants