defold / editor2-issues

DEPRECATED
44 stars 4 forks source link

With require in some cases functions are not added to auto complete #934

Open subsoap opened 7 years ago

subsoap commented 7 years ago

I have a file api_ext.lua

function sprite.play_animation(url, animation)
    msg.post(url, "play_animation", {id = hash(animation)})
end

In a script I have

require("defrs.utils.api_ext")

function init(self)
    sprite.play_animation("#sprite", "character_zombie")
end

If I type sprite. I am not shown sprite.play_animation() as an option.

If I instead do

local sprite_ext = require("defrs.utils.api_ext")

function init(self)
    sprite.play_animation("#sprite", "character_zombie")
    sprite_ext.
end

I can then see the function in autocomplete 2017-05-24 21_28_16-

I don't want to overwrite only extend and keep autocomplete working.

AGulev commented 6 years ago

@erikangelin-king maybe need to add “text-editor” label?