[ZeroBrane Studio] Add autocomplete for a library

  • From: "Steve Russell" <steve.russell@xxxxxxxxxxxxxxxxxxxxx>
  • To: <zerobrane@xxxxxxxxxxxxx>
  • Date: Fri, 26 Sep 2014 11:07:37 +0100

Hi,

 

I've implemented a set of C++ callback functions to allow Lua scripts to
access my application, accessible in Lua via the st library, with names such
as :

 

st.Log()

st. SleepMillis ()

 

I'm trying to add the library to autocomplete but not having much luck.

 

I created test.lua in api\lua\ and added "test" to interpreters\luabase.lua:

 

return {

  name = ("Lua%s"):format(name or version or ""),

  description = ("Lua%s interpreter with debugger"):format(name or version
or ""),

  api = {"wxwidgets","baselib","test"},  (line 16)

 

My test.lua is structured like this:

 

return {

  st = {

    type = "lib",

    description = "the st lib test",

 

    -- children in the class hierarchy

    childs = { -- recursive

      Log = {

        type = "function",

        description = "Log a message to the debug files",

        args = "(string)",

                                returns = "()",

      }

      SleepMillis = {

        type = "function",

        description = "Sleep a number of milli (1/1000) seconds.",

        args = "(number)",

        returns = "()",

      }

    }

  },

}

 

I've closed Zerobrane & re-opened it and was expecting to be able to type
"st." to get the list of Log & SleepMillis as autocomplete options, but
didn't.  Am I using it wrong?  I followed
http://studio.zerobrane.com/doc-api-auto-complete.html.

 

Regards,

Steve

Other related posts: