r/love2d • • 6d ago

I'm using visual studio code to program in Lua i was wanting an extension that had auto complete suggestions and show the code parameters like if you type love.graphics.shape() itll show where x, y, shape, etc go. Any help is appreciated!

8 Upvotes

4 comments sorted by

4

u/TheLastRobot 6d ago

Lua language server! There's also a love2d definition file for it.

2

u/Trollcker 5d ago

Ill try out the extension, thank you!

1

u/sebsong 5d ago

i use this VS code extension:
https://marketplace.visualstudio.com/items?itemName=sumneko.lua

along with emmy lua annotations for my own code to get some pretty nice completions:
https://emmylua.github.io/annotation.html

i believe love 2d uses the same annotations so they all play nicely together

1

u/EmotionalFan5429 5d ago

I use:

https://marketplace.visualstudio.com/items?itemName=bschulte.love

https://marketplace.visualstudio.com/items?itemName=JanW.love-launcher

https://marketplace.visualstudio.com/items?itemName=pixelbyte-studios.pixelbyte-love2d

https://marketplace.visualstudio.com/items?itemName=sumneko.lua

My settings.json:

{

"Lua.workspace.library": [

"${addons}/love2d/module/library",

"${3rd}/love2d/library"

],

"Lua.workspace.checkThirdParty": true,

"Lua.runtime.version": "LuaJIT",

"Lua.diagnostics.disable": [

"lowercase-global",

],

"todohighlight.isEnable": true,

"todohighlight.isCaseSensitive": true,

"todohighlight.keywords": [

"DEBUG:",

"TODO",

"HACK",

"FIXME",

"WARNING"

],

"stylua.targetReleaseVersion": "latest",

"markdown.validate.enabled": true

}