luacats / love2d Goto Github PK
View Code? Open in Web Editor NEWDefinitions for the LÖVE 2D game framework
Definitions for the LÖVE 2D game framework
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Windows
What is the issue affecting?
Diagnostics/Syntax Checking
Expected Behaviour
This might not be the place for this issue, if not feel free to close.
With löve2d when using Image:replacePixels it's reporting wrong number of arguments if you just give one, as in the example on the love2d wiki. image:replacePixels(imagedata)
The syntax checker is expecting 3: "data", "slice" and "reloadmipmaps". However "slice" only needs to be given if applicable (which it isn't with a plain texture) and "reloadmipmaps" defaults to true if the existing image has mipmaps and false if not. I appreciate it may be out of the scope of this plugin to know if these conditions are true or not.
The website in the hover over is also linking to the wrong page, it should be https://love2d.org/wiki/(Image):replacePixels
Actual Behaviour
Currently putting in the exaple from the love2d wiki gives an error about the nubmer of arguments.
Reproduction steps
Copy example from the love2d wiki page on Image:replacePixels (https://love2d.org/wiki/(Image):replacePixels)
See error being underlined
Also click the link in the hover, it goes to a non-page. This probably affects all "image" links as the wiki says these had parenthesis added to the link to as "image" was a reserved word in the wiki.
https://love2d.org/wiki/(Image):isCompressed
https://love2d.org/wiki/(Image):isFormatLinear
and https://love2d.org/wiki/(Image):replacePixels
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.
Hello,
The definitions in this addon have been generated from https://github.com/LuaLS/lua-language-server/blob/master/tools/love-api.lua by using ./bin/lua-language-server ./tools/build-3rd-meta.lua
. This uses https://github.com/love2d-community/love-api.
I would like help with maintaining this addon from someone knowledgeable about love2d. I have never really used it so I am not sure if it would be best to keep generating the documentation from https://github.com/love2d-community/love-api, or to manually update it, or if https://github.com/love2d-community/love-api is even accurate.
If someone could assist with managing issues on this addon and keeping the definitions up to date (using whatever method they think is best), that would be great! 🙂
Cross-posted from here: LuaLS/lua-language-server#2316
Basically, with LuaLS 3.7.0, this throws a warning.
local love = require("love")
function love.load() -- Fields cannot be injected into the reference of `love` for `load`. To do so, use `---@class` for `love`. (inject-field)
end
I expect the love.load
declaration to have no issues.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.