Corona IDE

Rob, the first thing (watch window doesn’t evaluate expressions) is a limitation of Corona simulator on OSX. There is a difference between the debug mode on Windows (which allows loadstring that debugger is using for remote console and watches) and on OSX (where loadstring is not available).

The second is the strange path that is being reported by Corona in some situations (the debugger just reports whatever path the engine tells it). ZBS still stops the application, so that you can set breakpoints and step through it, but it also tells you that it couldn’t find the location in the source code.

You can continue stepping through the code and in most cases the control will go back to the Lua code you are debugging; I’m working on an improvement that may put you there sooner if possible. [import]uid: 195109 topic_id: 34354 reply_id: 137593[/import]

@Magenda

> 1) The print output is not visible when Corona is selected as the Lua Interpreter. Is this on purpose or just a bug?

The simulator on Windows doesn’t redirect input/output as a “normal” application does (you can see it yourself; try running "Corona Simulator.exe" 1\>1 2\>2 and the output still goes to the console window). I can add an option to show the console window, but that’s probably all I can do.

When you run it under the debugger though, you will see the output in the Output window. Just add require('mobdebug').start() to your script, and the print output will be redirected to the output window.

> 2) Do you plan to add links, or even better live references, to Corona Documentation? You can see this feature in CodeHelper (Corona Complete) and other editors. It is super convenient to have the docs in your fingers!

Not sure; I couldn’t find a good source of Corona API documentation.

> 3) A Functions Navigator, as in IntelliJ and other editors, would be more than awesome. It helps much more than the Jump to… list that SL2 and other simpler editors have.

Do you mean the project tree that displays list of functions for every file and you can click on those to jump to the function definition? I don’t plan to have it in this format, but you will have a way to navigate functions (and other symbols) across your project files.

> In general, your editor is truly nice. Congrats!

Thank you; glad you enjoy it.

Paul. [import]uid: 195109 topic_id: 34354 reply_id: 137594[/import]

@Aidin, I took another stub at it and managed to make it work. You need to structure your code in a particular way to work around one Corona issue, but other than that it seems to be working on simple scripts I tried it with.

I’ll post details in a blog post in a day or two… [import]uid: 195109 topic_id: 34354 reply_id: 137595[/import]

@ paulclinger6

  1. I run ZBS under OSX 10.8, not windows. The “require” thing at the first row in main.lua didn’t help. Neither starting the project with F5. No logs either way…

  2. There must be a good source somewhere, since other editors generate the doc links and show the content depending what you are coding. Maybe Corona Team should help you on this!

  3. I can live without this.

Thanks for answering! [import]uid: 7356 topic_id: 34354 reply_id: 137608[/import]

@Magenda,

> The “require” thing at the first row in main.lua didn’t help. Neither starting the project with F5. No logs either way…

I’ve seen the output being buffered on OSX. You may want to add io.stdout:setvbuf('no') to your script to turn the output buffering off.

Paul. [import]uid: 195109 topic_id: 34354 reply_id: 137657[/import]

@ paulclinger6

That made the trick!
Thanks a lot. [import]uid: 7356 topic_id: 34354 reply_id: 137667[/import]

@aidin, Let me know how to make it perfect ;).

All, I’m working on a screencast that demonstrates debugging features of ZeroBraneStudio that can be used with Corona: breakpoints, watches, the stack view with variables, and the remote console to run arbitrary code and to update variables. I do have several demos for various engines (http://studio.zerobrane.com/tutorials.html), but want to also have one specifically for Corona. I’ll post an update when the screencast is published.

Paul. [import]uid: 195109 topic_id: 34354 reply_id: 137288[/import]

would like to change font size [import]uid: 7911 topic_id: 34354 reply_id: 137289[/import]

@jstrahan, you sure can: http://studio.zerobrane.com/doc-editor-preferences.html (size, name, and some other parameters in the editor).

You can also use Ctrl-MouseWheel to make it temporarily smaller/larger (not sure if it works on OSX though) [import]uid: 195109 topic_id: 34354 reply_id: 137297[/import]

@Ken,

Thank you for suggesting Lua Glider. We are happy that you are satisfied and we are trying hard to make Glider better. If you have any suggestions please feel free to post on our third party forum.

Regards,
M.Y. Developers [import]uid: 55057 topic_id: 34354 reply_id: 137301[/import]

preferences are grayed out on mac. control mousewheel does work [import]uid: 7911 topic_id: 34354 reply_id: 137303[/import]

> preferences are grayed out on mac.

Correct; you need to edit a configuration file to set preferences as described here: http://studio.zerobrane.com/doc-configuration.html. Thank you for checking Ctrl-MouseWheel. [import]uid: 195109 topic_id: 34354 reply_id: 137400[/import]

@paul:

I’m enjoying ZeroBrane very much and I’m coding with Corona SDK. A question though, when I stop at some breakpoint, is there anyway to see variables’ values in a better way? Currently I can see some crude “__class{ __index” thing which isn’t descriptive and neat and really cannot understand it. Worse is it’s not even complete and just watch window just shows some parts of the table’s confings.

It works better when you want to watch variables but most objects are tables in Corona and I’m afraid with the way ZeroBrane displays them, it’s not so much use to me.

Please help me on this. [import]uid: 206803 topic_id: 34354 reply_id: 137915[/import]

Thank you for the feedback; I’m glad you are enjoying the IDE. You have several ways to see values of variables and expressions:

  1. The Stack window; it will show all local values and upvalues and will allow you to expand tables.
  2. The Watch window; you can specify any expression you want and it will be evaluated after each debugger step. The results are shown as one pretty-printed line without a way to expand it.
  3. The tooltip; just mouse over a variable (or select an expression and mouse over it) to see the value.
  4. The console; you can execute any expression in the console and the result will be pretty printed for you. You can also do ‘=expression’ to pretty print the results in the block form.

Some of the data structures that Corona is using are quite complex and include references to other data structures. If you are using the Watch window you can simplify the expression to only show those elements you are interested in. If this still doesn’t work, can you send me the screenshot or a code fragment I can test it on? Thank you. Paul. [import]uid: 195109 topic_id: 34354 reply_id: 137922[/import]

Good to know! [import]uid: 199310 topic_id: 34354 reply_id: 137428[/import]

@paulclinger6

  1. The print output is not visible when Corona is selected as the Lua Interpreter. Is this on purpose or just a bug?

  2. Do you plan to add links, or even better live references, to Corona Documentation? You can see this feature in CodeHelper (Corona Complete) and other editors. It is super convenient to have the docs in your fingers!

  3. A Functions Navigator, as in IntelliJ and other editors, would be more than awesome. It helps much more than the Jump to… list that SL2 and other simpler editors have.

In general, your editor is truly nice. Congrats! [import]uid: 7356 topic_id: 34354 reply_id: 137451[/import]

I have been using Glider for 6 months. Best $30 I ever spent. Works awesome… [import]uid: 144922 topic_id: 34354 reply_id: 137457[/import]

@paulclinger6 I can get ZeroBraneStudio to launch Corona SDK, but I get this message in the console:

Program starting as '"/Applications/CoronaSDK/Corona Simulator.app" "/Users/rmiracle/Projects/Technolio/TP\_Series/TP-Shapes-V2/main.lua"'.  
Program unable to run as '"/Applications/CoronaSDK/Corona Simulator.app" "/Users/rmiracle/Projects/Technolio/TP\_Series/TP-Shapes-V2/main.lua"'.  

I tried setting a break point and it didn’t stop execution. I set this:

path.corona = '/Applications/CoronaSDK/Corona Simulator.app'  

in my user.lua file since it seems that most of user-sample.lua are windows oriented. Am I missing something?

[import]uid: 199310 topic_id: 34354 reply_id: 137531[/import]

Hi Rob,

It seems like your Corona installation is in /Applications/CoronaSDK; in this case you don’t need to set anything manually as ZBS will check this folder on OSX to see if Corona is there. In other words, remove path.corona setting from user.lua.

The reason why it didn’t work is that it expects that you reference the executable (not the app), so it would be something like “/Applications/CoronaSDK/Corona Simulator.app/Contents/MacOS/Corona Simulator”. The reason I can’t reference .app is that it may include multiple executables, so it needs to reference a specific one.

To get debugging to work, you need to add require('mobdebug').start() to your main.lua script. If you want to be able to use this outside of ZBS, then something like this should work if (system.getInfo("environment")=="simulator") then require("mobdebug").start() end.

For the breakpoints; you either need to set them before you start debugging, or you need to pause the running application (use “Project | Break”), set breakpoints, and the continue the script (use “Project | Continue”). You can start debugging with “Project | Start Debugging”.

I’ll cover all this in the screencast, but haven’t finished it yet. [import]uid: 195109 topic_id: 34354 reply_id: 137543[/import]

Paul,

Do you speculate we’ll have live coding for Corona as well anytime soon? [import]uid: 206803 topic_id: 34354 reply_id: 137544[/import]