Anyone Using Sublime Text 2?

Hi Everyone,

I got the API list from Lua Glider IDE, it downloads the raw corona .lua files for its own autocomplete.

This seems to be a common misconception about our autocomplete stubs. We actually went through the docs ourselves and created these lua files. In no way did we download any corona source! We would appreciate if you asked us before porting over our hard work to another IDE. The point of doing it this way as opposed to putting into a database or xml file is that we can use the same scanning engine for both autocomplete stubs and your own code. All the luadoc comments you see you can use for your own code and get the same type aware autocompletion you see for the Corona API. Also, it allows for some very powerful stuff. Like for instance:
 

--- @DeepInspect -- @param object @class DisplayObject -- @param bodyType @optional @class string @enum "static", "dynamic","kinematic" -- @param optionsTable -- @return -- function physics.addBody(object, bodyType, optionsTable ) object = Body end

what the code snippet does is attaches a Body class to the first parameter.The addBody function transformed the object parameter into a physics body object. Rather than using some obscure xml format to describe this behavior, we just use a simple lua function.

The result can be seen with the autocomplete:
 

screen_a47240e41608d4ab6001526dbb804bb2.

btw “Body” is just a lua table that looks like this:

---@extends DisplayObject local Body = {} Body.angularDamping = 1 Body.angularVelocity = 1 ---@enum "static", "dynamic", "kinematic" Body.BodyType ="" Body.isAwake = true Body.isBodyActive = true Body.isBullet = true Body.isFixedRotation = true Body.isSensor = true Body.isSleepingAllowed = true Body.linearDamping = 1

What is the purpose of the DeepInspect directive? When Glider inspects a lua function (either the stubs or your own functions) it “runs” the function in our homemade Lua virtual machine that analyzes the function to figure out a few things:

  • What are the parameters? What types are they? How many are there?
  • What is returned? How many returns? What are the types of those returns?
  • Where is this symbol being used? Has it been used before? Is this a declaration?

All this information is extracted automatically from parsing and analyzing lua source code. The Luadocs just help out the analyzer but they are not strictly required. For most functions, the first inspection result can be cached and reused, but there are a few functions with side effects that must be “re-run” every time. This is what the @DeepInspect directive does.

Take for instance:
screen_36cb893730deba21ffe8e7f70abdc296.

Glider can figure out all this so you don’t have to remember it or refer back and forth to documentation yourself.

And best of all you don’t need to learn any xml formats, its all just plain Lua code. And you can create your own stubs for your project, just create skeleton functions and the autocomplete entries will show up for you and the rest of your team.

We are going to open source our stubs and the Glider Corona Plugin. We need help updating the stubs to make the smartest autocomplete you have ever seen for lua. Please let us know if you are interested in contributing, we will create detailed documentation for how to create effective autocomplete stubs.

Regards,
M.Y. Developers

Thank you so much! That works great :smiley: I’m going to start using command B from now on! Nice find :smiley:

woo more Sublime fans! been using it since the original.

been trying sublime 2 for a short time now and must say Im really loving how the program works. What I wish was better is the autocomplete for Corona lua. Anyone know of any more complete or newer libraries for this other than those mentioned in this thread? 

There are none :frowning:

I’ve searched web all over, but found nothing that wasn’t in this thread already. It’s really a shame.

to bad indeed. Would have been really awesome if this had a complete list for corona. Is it hard to make such a thing? could be start a gitHub collaboration, maybe based on what is out there now and help each other to add the missing pieces?

I don’t think this one was mentioned, it is a lot more current than the TextMate port.  It has a few quirks though, but is current up to 1076 and some ways a lot better.

https://github.com/lano78/SublimeCoronaSDK

The developer is no longer supporting it, but I am going to see if I can get someone to fix the quirks or look into it myself.

cspence: awesome, thanks! that one was indeed more complete at least :slight_smile:

been trying sublime 2 for a short time now and must say Im really loving how the program works. What I wish was better is the autocomplete for Corona lua. Anyone know of any more complete or newer libraries for this other than those mentioned in this thread? 

There are none :frowning:

I’ve searched web all over, but found nothing that wasn’t in this thread already. It’s really a shame.

to bad indeed. Would have been really awesome if this had a complete list for corona. Is it hard to make such a thing? could be start a gitHub collaboration, maybe based on what is out there now and help each other to add the missing pieces?

I don’t think this one was mentioned, it is a lot more current than the TextMate port.  It has a few quirks though, but is current up to 1076 and some ways a lot better.

https://github.com/lano78/SublimeCoronaSDK

The developer is no longer supporting it, but I am going to see if I can get someone to fix the quirks or look into it myself.

cspence: awesome, thanks! that one was indeed more complete at least :slight_smile:

Edit: didn’t see post above :S

Edit: didn’t see post above :S

Finally! Thank you corona labs:

http://coronalabs.com/products/editor/

I just hope that the API autocompletion will be maintained with daily builds :slight_smile:

Finally! Thank you corona labs:

http://coronalabs.com/products/editor/

I just hope that the API autocompletion will be maintained with daily builds :slight_smile: