EmmyLua / IntelliJ-EmmyLua

Lua IDE/Debugger Plugin for IntelliJ IDEA
https://emmylua.github.io
Apache License 2.0
1.74k stars 293 forks source link

Association of imported libraries with annotations #409

Open u546342 opened 3 years ago

u546342 commented 3 years ago

Is there any way to automatically associate import of libraries with separately written annotations for them?

Current workaround:

--- @type somelib
local somelib = require "somelib"

But it's not very convenient. Thanks.

CppCXY commented 3 years ago

project structure > module > mark as source.

u546342 commented 3 years ago

Sorry, but I don’t understand how your example can help. Consider an example with Defold game engine. All modules in it are stored by zip archives in directory .interal/lib. So Emmylua plugin can’t read archives and analyze lua sources in them. The possible solution is to have in project separate files with empty dummy functions with emmylua annotations. But it requires to specify the type of module when importing it. Just as I showed in the first message.