You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I build a game with the love2d engine. The game is written in lua so I tried to use emacs lsp-lua
with this lua language server.
Here is an example of a "hello world" game :
locallove=require"love"functionlove.draw()
love.graphics.print("Hello World", 400, 300)
end
This "game" is run with the love engine : love.exe directory\where\is\the\file
The "require" line is not mandatory for the game to start, I put it because otherwise the lua language server
considers "love" as undefined. When I put it, I assume the lua language server picks up the "love.dll" which
is in the same directory as "love.exe".
However, autocompletion does not seem to work as for regular lua package. I noticed that I am only
proposed the "love" fields and functions which are already used in the script.
The language server can only parse lua file, so I think maybe you should use a library file. For example, you can use Emmy Lua LOVE API, or you can use my fork which I think is much more complete than the original one and still under active maintenance.
Activity
ImpleLee commentedon Apr 19, 2021
The language server can only parse lua file, so I think maybe you should use a library file. For example, you can use Emmy Lua LOVE API, or you can use my fork which I think is much more complete than the original one and still under active maintenance.
deb75 commentedon Apr 27, 2021
Hi,
Thanks very much, I will try your fork as soon as possible.
Regards
nayibor commentedon Aug 30, 2025
i managed to get auto completion working using emacs.
these link helped.
https://github.com/LuaLS/lua-language-server/wiki/Libraries.
emacs-lsp/lsp-mode#2818
in the end i had to modify my emacs init file and add the workspace library like below.
you can also place a .luarc.json configuration file in your project folder which also works