Issues

Issue #105 duplicate

auto completion for 5.2 style modules

Anonymous created an issue

Hi, apologies if this issue is covered by another, I've been searching the issues, but perhaps I've missed a relevant one due to my lack of depth in my understanding of lua modules.

If I define a module the recommended Lua 5.2 way, with no module command, e.g.:

{{{

!lua

local my_new_module = {}

function my_new_module.a_new_function() return "whatever" end }}}

then require it in a second file: {{{

!lua

local my_aliased_module = require "my_new_module" my_new_module.blah().... }}}

Then I don't receive any completions in the second file after //my_new_module. // has been typed. Is this a known limitation?

Thanks Theo

Comments (4)

  1. Anonymous

    Apologies, the lua module code should read:

    local my_new_module = {}
    
    function my_new_module.a_new_function()
        return "whatever"
    end
    
    return my_new_module
    

    I missed off the return value. Thanks, Theo.

  2. Anonymous

    oh dear, and the second piece of code should read:

    local my_aliased_module = require "my_new_module"
    my_aliased_module.blah()....
    
  3. Log in to comment