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

Association of imported libraries with annotations

Open u546342 opened this issue 4 years ago • 2 comments

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.

u546342 avatar Feb 14 '21 10:02 u546342

project structure > module > mark as source.

CppCXY avatar Feb 15 '21 03:02 CppCXY

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.

u546342 avatar Mar 17 '21 12:03 u546342