Globals from Lua 4.0 files included with "dofile": possible? #2422
Unanswered
macmacy
asked this question in
General Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi. I've just started with lua-language-server, so excuse me if this is kind of RTFM.
I have some legacy Lua 4.0 code. You know: no modules, just .lua files loaded with "dofile".
When I have a e.g.
modulefunfunction inmymodule.lua, which I load inmain.luawithdofile("mymodule"), lua-server gives "Undefined global 'modulefun' on modulefun(param) function call (when inmain.luafile in editor).Kind of no surprise, as lua-language-server docs state clearly it supports Lua >=5, so I can imagine it handles "require" rather than "dofile".
BUT, I've noticed that if I add this to .luarc.json:
(where
c:/mylualib/is directory where mymymodule.luais located) then, lua-language-server properly displays parameters hints onmodulefuncall, but still says "Undefiled global" for this function.This proves language server knows SOMETHING about included file as it displays hints, but still considers functions from it "Undefined globals". Any recipe to have it working with Lua 4?
Beta Was this translation helpful? Give feedback.
All reactions