Closed sumneko closed 3 years ago
I found this problem in many places. I think we need a more elegant way to solve this problem.
A proper way to discard the 2nd value is to wrap them in parenthesis, like {..., (require("something")), ...}
. You probably need to do that in many places however.
Not sure how your lua-language-server handle such cases however.
I'm not sure if this problem needs to be solved, because I may be the only one who use Lua 5.4 to load this file. And I have solved this problem by simulating the behavior of Lua 5.1: https://github.com/sumneko/lua-language-server/blob/bc6dd9b20925d21e6def32170854b27f69ca50d9/tools/love-api.lua#L4-L5
In Lua 5.4,
require
will return more than one return value, causing unexpected values to be inserted into the array.