LuaCATS / love2d

Definitions for the LÖVE 2D game framework
10 stars 4 forks source link

Missing `newText` definition #1

Closed clembu closed 2 months ago

clembu commented 11 months ago

According to https://love2d.org/wiki/love.graphics.newText there is a love.graphics.Text constructor that accepts a table as a second parameter, interpreting it as "colored text". It seems to work fine in Löve 11.4, yet this variant is missing from the definition file.

I would submit a PR but I don't know how the doc comments work, and I don't have the time right now to get into it, so I thought I'd report it first, before I forget.

C3pa commented 8 months ago

Hey @carsakiller are these still built from this repo: https://github.com/love2d-community/love-api? If so, that's the place where you can document the overload.

carsakiller commented 8 months ago

@C3pa what do you mean still? Were the definition files for love2d automatically generated somewhere?

C3pa commented 8 months ago

IIRC, when these were part of the Lua Language Server repository, there was a Lua script that generated these annotations from this: https://github.com/love2d-community/love-api

carsakiller commented 8 months ago

I used the lua-language-server's script to update the API but I don't see any mention of newText or .Text, even in https://github.com/love2d-community/love-api.

C3pa commented 8 months ago

Yes, you are right. I asked because I wanted to know if this function should be documented in the love-api repository first as we did before for these kinds of issues, or if we are planning to diverge from that repo and maintain the annotations ourselves (which, IMHO, sounds a bit counter-productive).

carsakiller commented 8 months ago

@C3pa I think correcting the community documentation makes the most sense, and we can just continue to run the script to generate these definitions.

C3pa commented 7 months ago

Missing documentation was merged to love-api repository. Re-running the build script should fix this issue.

carsakiller commented 2 months ago

I have updated the API just now, if this is still an issue, perhaps the upstream documentation needs a fix?

C3pa commented 2 months ago

The upstream definitely has the mentioned overload: https://github.com/love2d-community/love-api/blob/master/modules/graphics/Graphics.lua#L2932. Maybe there's an issue with the build script: https://github.com/LuaLS/lua-language-server/blob/master/tools/love-api.lua?

carsakiller commented 2 months ago

Okay, hopefully https://github.com/LuaCATS/love2d/commit/173c3f38444a27d54c4479012390cc4c7c528b29 has fixed things

C3pa commented 2 months ago

Looks like the missing overload is here: https://github.com/LuaCATS/love2d/commit/173c3f38444a27d54c4479012390cc4c7c528b29#diff-0425179d2060217d85572f6b7c72c316c23b6565f196a7ac46496e79533606cbR839

carsakiller commented 2 months ago

Awesome!