IntelliJ-Luanalysis icon indicating copy to clipboard operation
IntelliJ-Luanalysis copied to clipboard

No such member when using package.preload

Open sosodev opened this issue 3 years ago • 2 comments

Environment

name version
IDEA version GO2020.3
Luanalysis version 1.2.2-IDEA203
OS Linux

What are the steps to reproduce this issue?

  1. Use package.preload to register a module
package.preload['mymodule'] = function()
-- ...
end

What happens?

Luanalysis raises the error "No such member 'mymodule' found on type table"

What were you expecting to happen?

No error :)

Any other comments?

This project is really awesome by the way. It's super cool to have something like this for Lua.

sosodev avatar Apr 03 '21 18:04 sosodev

You also do require it, right? From your code sample:

local mymodule = require("mymodule")

adriweb avatar Apr 03 '21 18:04 adriweb

This is in the context of an application that preloads these modules before running user scripts which require these modules. They're not required internally, no.

sosodev avatar Apr 03 '21 20:04 sosodev