ZeroBrane Studio - autocomplete query

Hi

  I am trying to work with a free editor or IDE and on trying most of the paid for editors or IDEs I decided to try out ZeroBrane IDE. It is a very different way of working to what I am using (I think sublime is very similar) in that a folder seems to have to be created first and then the files etc are added to this afterwards.

  My main query is on the autocomplete , if for instance I created a local variable based on the display.newRect , then when I type in that variable and enter the ‘.’ on some of the other editors/IDEs I get a full list of all of the objects functions and methods, it seems to me that ZeroBrane does not do this such as anchorX and Y plus just entering x or y does not find these either. 

 Is this a setting that I have missed as I looked at the settings that are for autocomplete from the documentation and cannot get this to work

Thanks

TimCS

> if for instance I created a local variable based on the display.newRect , then when I type in that variable and enter the ‘.’ on some of the other editors/IDEs I get a full list of all of the objects functions and methods, it seems to me that ZeroBrane does not do this such as anchorX and Y plus just entering x or y does not find these either.

@TimCS, it happens because newRect returns ShapeObject, which doesn’t have anchorX/Y methods, but it inherits from DisplayObject, which does have those methods. The API documentation file I used to generate the auto-complete docs doesn’t seem to have the information about inheritance and that’s why it’s not currently taken into account. You can apply the following diff to see the result when the inheritance is taken into account (which should give you the expected result):

diff --git a/api/lua/corona.lua b/api/lua/corona.lua index 430bb04..810f811 100644 --- a/api/lua/corona.lua +++ b/api/lua/corona.lua @@ -1335,6 +1335,7 @@ do return {     }    },    description = "Vector display objects are objects created without the use of images, such as rectangles, circles, rounded rectangles, and lines.", +  inherits = "\_DisplayObject",    type = "class"   },   \_SliderWidget = {

I’ll check on where I can get the inheritance information and will update the API description to include that. Thanks. Paul.

@TimCS, I updated the API description to include inheritance information and also upgraded the API to the latest version (v2015.2731). If you can’t use the latest version of ZeroBrane Studio from git, you can just grab the file with corona API and copy it to your instance: https://github.com/pkulchenko/ZeroBraneStudio/blob/master/api/lua/corona.lua. This should fix the issue with missing methods. Paul.

@Paulclinger

 Thanks for this and sorry for the stupid question , I am running ZeroBrane Studio on the Mac, how do I go about applying this ?

TimCS

> I am running ZeroBrane Studio on the Mac, how do I go about applying this ?

@TimCS, you need to right click on ZeroBrane Studio application and select Show Package Contents. Then go to ZeroBraneStudio/api/lua folder and replace corona.lua file with the updated one from the link above.

 @Paulclinger 

 Thank you for this I will give this a go

TimCS

> if for instance I created a local variable based on the display.newRect , then when I type in that variable and enter the ‘.’ on some of the other editors/IDEs I get a full list of all of the objects functions and methods, it seems to me that ZeroBrane does not do this such as anchorX and Y plus just entering x or y does not find these either.

@TimCS, it happens because newRect returns ShapeObject, which doesn’t have anchorX/Y methods, but it inherits from DisplayObject, which does have those methods. The API documentation file I used to generate the auto-complete docs doesn’t seem to have the information about inheritance and that’s why it’s not currently taken into account. You can apply the following diff to see the result when the inheritance is taken into account (which should give you the expected result):

diff --git a/api/lua/corona.lua b/api/lua/corona.lua index 430bb04..810f811 100644 --- a/api/lua/corona.lua +++ b/api/lua/corona.lua @@ -1335,6 +1335,7 @@ do return {     }    },    description = "Vector display objects are objects created without the use of images, such as rectangles, circles, rounded rectangles, and lines.", +  inherits = "\_DisplayObject",    type = "class"   },   \_SliderWidget = {

I’ll check on where I can get the inheritance information and will update the API description to include that. Thanks. Paul.

@TimCS, I updated the API description to include inheritance information and also upgraded the API to the latest version (v2015.2731). If you can’t use the latest version of ZeroBrane Studio from git, you can just grab the file with corona API and copy it to your instance: https://github.com/pkulchenko/ZeroBraneStudio/blob/master/api/lua/corona.lua. This should fix the issue with missing methods. Paul.

@Paulclinger

 Thanks for this and sorry for the stupid question , I am running ZeroBrane Studio on the Mac, how do I go about applying this ?

TimCS

> I am running ZeroBrane Studio on the Mac, how do I go about applying this ?

@TimCS, you need to right click on ZeroBrane Studio application and select Show Package Contents. Then go to ZeroBraneStudio/api/lua folder and replace corona.lua file with the updated one from the link above.

 @Paulclinger 

 Thank you for this I will give this a go

TimCS