Open LoganDark opened 2 years ago
Define these variables in pure comment files, put them in the workspace or package them as zips introduced through the project strucure module. a simple openresty doc
Define these variables in pure comment files, put them in the workspace or package them as zips introduced through the project strucure module. a simple openresty doc
So make a file named something .def.lua
, then define global variables & functions inside them with empty bodies?
Environment(环境)
I want to use EmmyLua for type checking / documentation / autocomplete when making OpenResty scripts. For that I want to add typings for all of the globals that are added, like
ngx
,udpsock
,tcpsock
, etc. But I don't know how to do so.Looking at the annotations documentation I can't see any annotation that can be used to declare that a variable already exists. I can define it like
local ngx = {}
and thenfunction ngx.say(...)
after, like the Lua standard library, but I don't think that would be a global and it would also create side effects at runtime.Is there any way to do this or is it a missing feature? Thanks