diff options
Diffstat (limited to 'script-beta/core/definition.lua')
-rw-r--r-- | script-beta/core/definition.lua | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/script-beta/core/definition.lua b/script-beta/core/definition.lua index 865fc7cb..5f16ad84 100644 --- a/script-beta/core/definition.lua +++ b/script-beta/core/definition.lua @@ -58,14 +58,17 @@ local function checkRequire(source, offset, callback) if type(literal) ~= 'string' then return end - local name = func.special - if name == 'require' then + local lib = vm.getLibrary(func) + if not lib then + return + end + if lib.name == 'require' then local result = workspace.findUrisByRequirePath(literal, true) for _, uri in ipairs(result) do callback(uri) end - elseif name == 'dofile' - or name == 'loadfile' then + elseif lib.name == 'dofile' + or lib.name == 'loadfile' then local result = workspace.findUrisByFilePath(literal, true) for _, uri in ipairs(result) do callback(uri) |