-
Given the following piece of code, how can I annotate it correctly, so that type of _G.req = function(module_name)
local ok, module = xpcall(require, err_handler, module_name)
if not ok then
print("There was a problem loading " .. module_name .. " module")
end
return module
end
local module = req("lsp.functions")
local module2 = require("lsp.functions")
Or maybe there is a workaround? |
Beta Was this translation helpful? Give feedback.
Answered by
sumneko
Nov 21, 2022
Replies: 1 comment 1 reply
-
"Lua.runtime.special": {
"req": "require"
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
sarmong
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
require
is specially treated, you can use the following config: