Class autocompletion and custom SDK

HI!

We just added an embed Lua interpreter to our game engine and we need a good Lua IDE. Lua Glider seems to fit our need, I know that it’s more fitted for corona and moai, but it’s by far the favorite of the team (they’ve tried the demo).

I found two problems that clash a bit with our workflow,  but they are small ones that I think could be fixed easily. I would like to know if there is way to contribute to the project or if there is a way for adapting glider to our workflow. 

First problem

The autocompletion on our class system.

Our class constructor are defined in the “__call” metatable member.

I use something similar to this for my object model : 

http://lua-users.org/wiki/SimpleLuaClasses (See the “A simplified way of creating class” section)

So when I do stuff like this:

MyClass = class() function MyClass:myFunction()    print("yeah") end anObject = MyClass()  

I have no autocompletion on “anObject”

It would be really nice if the autocompletion would see this :

anObject = MyClass()

as  this

anObject = MyClass

Or at least if I could manually tell the return type of my table called as a function. (the “__call” metatable field)

Second problem

Not so much a problem, but maybe you could give me a head start.
I am trying to integrate my custom interpreter as a plugin so I could debug lua file running in our engine with glider.

I haven’t found any documentation about it, so I was reverse engineering my way to it. (By analysing the existing lua, corona and moai plugin.)

Anything that I should know that could help me ?

I would have fixed those already, but since the project isn’t open source I can’t really contribute to it. :frowning:

Also, just my opinion, but I think you should market the IDE as a more general purpose lua editor, not just corona. You are probably losing some sales! We almost skipped it when searching for the perfect fit because it seemed too corona centric. 

 

Thanks! 

Hello Joe,

Thanks for the feedback. Yes we are trying to push towards a more general purpose IDE. Glider initially started out as Corona only IDE and after some major refactoring we were able to pull all the SDK specific stuff into the plugin system. We are working on getting the documentation and website up to speed so we apologize for not having those up to date yet. The main reason for this was to allow the plugin api to stabilize enough so that we can make it public. 

Our class constructor are defined in the “__call” metatable member.

Ah yes, we need to update the VM to support more metatable operations. So far it only supports the __index meta-entry but more are coming soon. You can optionally tell Glider what the class of a table is using the @class directive. Here is an example of how it works:

---@classdef ball local ballClass = {} ballClass.color = "red" --note, As long as you tell Glider the class at any one of these --locations below it can infer the rest. ---@return @class ball

local function  ballConstructor()

    —@class ball

    local someVar = {}    

    return someVar

end

@class ball instance = ballConstructor()

Notice the classdef directive at line 1, you need to tell Glider what an instance of your class looks like. You can either do this somewhere in your code but we prefer you do it in an autocomplete stub. Note that you would only have to put the —@class ball directive on either the constructor function return or the instance itself  (it would be redundant to put it on both).

We don’t like polluting your code with these comments but when type inference fails you have this system as a fallback. Ideally Glider will be able to infer everything without any help from you.

I am trying to integrate my custom interpreter as a plugin so I could debug lua file running in our engine with glider.

We have attached a plugin template archive. All you would need to do is extract the folder into the “UserPlugins” folder of your user directory. You can access your userdir by help-> user directory.

You should then see “Sample Plugin plugin loaded successfully” in the Output window.

Now when you go to tools->options->Glider options you should see your “Sample Plugin” entry in there.

Next just drag and drop the PluginTemplate folder into the editor, you can then develop your Glider plugin inside Glider itself. Each time you save the plugin.lua file it will reload the plugin.

The plugin.lua contains a whole bunch of extension entry points. Aside from the required “getPlugininfo” function, you should implement the “getLaunchCommandDebug” which allows you to launch a command line task (your interpreter) when the debug button is pressed.  

For now you could just hardcode the path to your simulator executable in the getLaunchCommandDebug itself, or you can use the args.options table to get the relevant options set in the preferences panel.

Please refrain from using os.execute. Instead just return a table with a “cmd” table in it. Please see the example for more info.

Please let us know about your experiences with the plugin development system.

Regards,

M.Y. Developers

Thanks! 

Do you have a blog, a roadmap or something were we can get a feel of what is coming and when it’s coming ? 

 

Also I only have choice of 5 font on osx :frowning: I don’t have the normal netbeans font dialog.

Hello Joe,

Also I only have choice of 5 font on osx

Thanks for the report. We will see what we can do about this. 

Regards,

M.Y. Developers

Hello Joe,

Thanks for the feedback. Yes we are trying to push towards a more general purpose IDE. Glider initially started out as Corona only IDE and after some major refactoring we were able to pull all the SDK specific stuff into the plugin system. We are working on getting the documentation and website up to speed so we apologize for not having those up to date yet. The main reason for this was to allow the plugin api to stabilize enough so that we can make it public. 

Our class constructor are defined in the “__call” metatable member.

Ah yes, we need to update the VM to support more metatable operations. So far it only supports the __index meta-entry but more are coming soon. You can optionally tell Glider what the class of a table is using the @class directive. Here is an example of how it works:

---@classdef ball local ballClass = {} ballClass.color = "red" --note, As long as you tell Glider the class at any one of these --locations below it can infer the rest. ---@return @class ball

local function  ballConstructor()

    —@class ball

    local someVar = {}    

    return someVar

end

@class ball instance = ballConstructor()

Notice the classdef directive at line 1, you need to tell Glider what an instance of your class looks like. You can either do this somewhere in your code but we prefer you do it in an autocomplete stub. Note that you would only have to put the —@class ball directive on either the constructor function return or the instance itself  (it would be redundant to put it on both).

We don’t like polluting your code with these comments but when type inference fails you have this system as a fallback. Ideally Glider will be able to infer everything without any help from you.

I am trying to integrate my custom interpreter as a plugin so I could debug lua file running in our engine with glider.

We have attached a plugin template archive. All you would need to do is extract the folder into the “UserPlugins” folder of your user directory. You can access your userdir by help-> user directory.

You should then see “Sample Plugin plugin loaded successfully” in the Output window.

Now when you go to tools->options->Glider options you should see your “Sample Plugin” entry in there.

Next just drag and drop the PluginTemplate folder into the editor, you can then develop your Glider plugin inside Glider itself. Each time you save the plugin.lua file it will reload the plugin.

The plugin.lua contains a whole bunch of extension entry points. Aside from the required “getPlugininfo” function, you should implement the “getLaunchCommandDebug” which allows you to launch a command line task (your interpreter) when the debug button is pressed.  

For now you could just hardcode the path to your simulator executable in the getLaunchCommandDebug itself, or you can use the args.options table to get the relevant options set in the preferences panel.

Please refrain from using os.execute. Instead just return a table with a “cmd” table in it. Please see the example for more info.

Please let us know about your experiences with the plugin development system.

Regards,

M.Y. Developers

Thanks! 

Do you have a blog, a roadmap or something were we can get a feel of what is coming and when it’s coming ? 

 

Also I only have choice of 5 font on osx :frowning: I don’t have the normal netbeans font dialog.

Hello Joe,

Also I only have choice of 5 font on osx

Thanks for the report. We will see what we can do about this. 

Regards,

M.Y. Developers

We have attached a plugin template archive. All you would need to do is extract the folder into the “UserPlugins” folder of your user directory. You can access your userdir by help-> user directory.

I don’t see any attachment, have you forgot it ? 

[EDIT]  I found that pdf that give more details on another post : 

www.mydevelopersgames.com/LuaGlider.pdf

So nervermind !

We have attached a plugin template archive. All you would need to do is extract the folder into the “UserPlugins” folder of your user directory. You can access your userdir by help-> user directory.

I don’t see any attachment, have you forgot it ? 

[EDIT]  I found that pdf that give more details on another post : 

www.mydevelopersgames.com/LuaGlider.pdf

So nervermind !

Hello Lachhh,

Was the document helpful for you?

Regards,

M.Y. Developers

YEs, the doc was good, I’m still checking out the possibilities, but if I have some questions, I’ll get back to you.

Thanks for the great support by the way. I find you guys very responsive :slight_smile:

Thumbs Up !

Hello Lachhh,

Was the document helpful for you?

Regards,

M.Y. Developers

YEs, the doc was good, I’m still checking out the possibilities, but if I have some questions, I’ll get back to you.

Thanks for the great support by the way. I find you guys very responsive :slight_smile:

Thumbs Up !