title: How to get autocompletion for custom modules in Lua
body: <p>Whatever the setup I use for coding in Lua is always the same thing: autocompletion works for the standard libraries but not for the 3rd parties or my own libraries.</p>
  
  <p>I tried ZeroBrane studio, VSCode with Lua plugin and Vim with lua ftplugin, exact same behaviour in all 3. I start typing a standard library symbol such as</p>
  
  <blockquote>
    <p>io.w</p>
  </blockquote>
  
  <p>And I do get the autocompletion popup showing everything in the io module, and showing the closest method to io.w which would be io.write, with the signature and documentation.</p>
  
  <p>Now I try a 3rd party or my own library such as</p>
  
  <blockquote>
    <p>require("wx"); wx.</p>
  </blockquote>
  
  <p>or</p>
  
  <blockquote>
    <p>require("my_module"); my_module.</p>
  </blockquote>
  
  <p>Either nothing happens at all, or I get a warning "undefined" on the module name.
  If I run the code with the interpreter, it does work. It will call the function in the module just fine. But in the editor, warning and no autocompletion.</p>
  
  <p>Am I missing something?</p>