Corona Editor 0.8.8

A new release of Corona Editor is live.  Restart your copy of Sublime Text to get it if you’ve installed it using Package Control.

We haven’t coordinated with  develephant’s contributions yet but we aren’t ignoring them.  There are only so many hours in the day but I plan to take a look at his pull request next.

I think completions are closer to what folks will like but let me know what you think (there are several preferences to fine tune their behavior).  Bear in mind that Sublime Text can’t parse Lua so it isn’t possible for the plugin to know about some valid completions.  Basically if a “correct” set of completions relies on knowledge that a variable has a certain value or type then the completions shown wont necessarily be as expected.  This is different to environments like Visual Studio or Xcode which are constantly compiling the code and determining types and context.  We’ll continue to improve completion but I just wanted to explain the limitations of the system.

Always check the README for the latest information.

0.8.8

Completions
Completions now (optionally) do fuzzy matching on the available
completions. Behavior of completions around periods has been improved.
There are completions for both “public” and “daily” APIs.

 

Building works correctly
Multiple builds now result in just one Simulator whose output goes into the build results window on MacOSX and Windows. This requires Daily Build 1240 or higher (on older builds you’ll still get multiple Simulators started). Also fixed issue with “\Program Files (x86)” folder on Windows.

 

Building in projects works
It’s now possible to hit Super+B on any .lua file in a project and have the Simulator loadmain.lua as expected.

 

Documentation Lookup
Fine tuned documentation lookup so that “lfs”, “socket”, “sqlite3”
trigger searches.

Briefly talked about this build in the Coronium thread. Suffice to say, some great fixes.

The big request for me is full autocomplete on table objects.

local box = display.newGroup() box.frame = display.newRect(0,0,32,48) box.frame:setReferencePoint(display.CenterReferencePoint) -- :setReferencePoint() does not appear as an autocomplete. -- In fact, the only thing that does is :setFillColor() -- In addition, there is no autocomplete for display.CenterReferencePoint. -- Not just the point, but display. has nothing either. -- My guess is just that there's no support for autocomplete of strings within an already unrecognized object?

Completions now (optionally) do fuzzy matching: How I use it ? actualy now It very bad. I almost code my self.

I have use this one. I good but same not update. srr I dont have permit to attach file :frowning:

How do I tell if I have 0.8.8?  My package-metadata shows

{“url”: “http://www.coronalabs.com”, “version”: “2013.10.09.17.53.30”, “description”: “Corona Editor is the official Corona SDK plugin for Sublime Text”}

I assume just restarting Sublime is enough to update?

doug

Restarting Sublime Text should be sufficient though I’ve heard that some people have to remove and reinstall the plugin to get it to update. I’m looking into this.

The internal version numbers should now match the ones I’ve been referring to in my posts.

Try the latest version (0.8.9) and see if you like it better. I’ve tried to incorporate your suggestions.

Sorry for the delay, but haven’t had time to play with experimental stuff due to baby constraints. :wink:

Issues (0.8.9 with SublimeText 3 OSX Mavericks)

  1. No support for display.* - no display library calls get autocomplete as best I can tell

  2. No autocomplete for :setFillColor, :setStrokeColor on objects except if you’ve used the command already in the code file

  3. No support for any sort of . property autocomplete (i.e.: .width and other default corona properties)

  4. No support for autocomplete of setReferencePoint() or the various display. reference points.

  5. No support for transition.*

  6. No support for storyboard.*

Maybe i’m missing something? Virtually everything is missing. I guess I can autocomplete table.* but that’s not terribly useful compared to the other libraries…

That doesn’t make any sense at all :slight_smile:

Can you try removing the Corona Editor package and re-installing it? We’ve had some reports that Package Control doesn’t seem to be doing this automatically for everyone.

These are just a few of the “display” completions that should be available:

{ "trigger": "display.getCurrentStage()\tdisplay", "contents": "display.getCurrentStage( )"}, { "trigger": "display.imageSuffix\tdisplay", "contents": "display.imageSuffix"}, { "trigger": "display.loadRemoteImage()\tdisplay", "contents": "display.loadRemoteImage( ${1:url}, ${2:method}, ${3:listener} ${4:[, params]}, ${5:destFilename} ${6:[, baseDir]} ${7:[, x, y]} )"}, { "trigger": "display.newCircle()\tdisplay", "contents": "display.newCircle( ${1:[parentGroup,]}, ${2:xCenter}, ${3:yCenter}, ${4:radius} )"}, { "trigger": "display.newEmbossedText()\tdisplay", "contents": "display.newEmbossedText( ${1:[parentGroup,]}, ${2:string}, ${3:left}, ${4:top}, ${5:[width, height,]}, ${6:font}, ${7:size} )"}, { "trigger": "display.newGroup()\tdisplay", "contents": "display.newGroup( )"}, { "trigger": "display.newImage()\tdisplay", "contents": "display.newImage( ${1:filename} ${2:[,baseDirectory]} ${3:[, left, top]} )"}, 

I’ll give it a try tonight - soonest I’ll have access. I’ll admit it was really strange, but on the other hand this was a fresh install of ST3 and Corona Editor. (I previously was doing testing of this stuff on my desktop, this was my first attempt with a laptop.)

I’ve just tried this out in my Sublime 3 test account and not only did it automatically update to the latest release, the completions worked as well:

S3screenshot.jpg

I wonder what the next step to reproduce this is.

I see what’s happening now. It’s adaptable (not sure if fixable) and does not require any sort of reinstall.

  1. If you don’t save the file, there is no autocomplete, period. Programming language settings have no effect other than to colorize your code. So Corona Editor is dead in the water until you save, but works perfectly after. Except…

  2. If you save your file for the first time, ST3 automatically overrides your language choice and sets it to vanilla “Lua”, even if you had Corona SDK Lua set. So you need to set the language manually.

  3. If you open a lua file (File>Open) language settings are not saved. It will always load the default Lua file (unless there is some way to override what the default lua language choice is?)

Language settings are saved, however, if you open a project. Whenever you quit ST3, it saves your layout exactly as you left it, including language. This seems great, but if you have a lot of code files and close one for whatever reason, it’s out of the project data and any attempt to reopen that file (including Open>Recent) means it will default back to vanilla Lua.

tl;dr if there’s a way to change ST3 to look at Corona SDK Lua as the primary Lua that would probably fix quite a few misconceptions about how this works.

Thanks for the detailed report.  I made a choice early on to identify “lua files” by the .lua extension because I thought that would be less confusing than some other options Sublime offers but clearly it doesn’t work until the file actually has a name.  I’ll go back to the drawing board and see what I can come up with.

Obviously I need to add “creating new lua files” to my test cases.

I’m wondering if the language assignment is some quirk to ST3 as well? I just opened a file on my mainline environment (ST2+OSX) and it assigns my own (older) Corona SDK Lua variant automatically. You should try seeing if Corona Editor does the same on ST2, or if that’s something that can be fixed with some kind of package setting or user setting.

One thing I’ve found is that ST does remember the syntax setting on a per open file basis even if the setting for a file disappears (due to package changes).  This can make it quite hard to get it to forget about an old setting (it seems like it keeps reverting but in reality you’re just looking at another tab you haven’t opened since the syntax file changed).  ST seems to realize this is an issue because there’s the View > Syntax > Open all with current extension as… > <syntax-type> command to fix things.  Perhaps that can be automated.

Briefly talked about this build in the Coronium thread. Suffice to say, some great fixes.

The big request for me is full autocomplete on table objects.

local box = display.newGroup() box.frame = display.newRect(0,0,32,48) box.frame:setReferencePoint(display.CenterReferencePoint) -- :setReferencePoint() does not appear as an autocomplete. -- In fact, the only thing that does is :setFillColor() -- In addition, there is no autocomplete for display.CenterReferencePoint. -- Not just the point, but display. has nothing either. -- My guess is just that there's no support for autocomplete of strings within an already unrecognized object?

Completions now (optionally) do fuzzy matching: How I use it ? actualy now It very bad. I almost code my self.

I have use this one. I good but same not update. srr I dont have permit to attach file :frowning:

How do I tell if I have 0.8.8?  My package-metadata shows

{“url”: “http://www.coronalabs.com”, “version”: “2013.10.09.17.53.30”, “description”: “Corona Editor is the official Corona SDK plugin for Sublime Text”}

I assume just restarting Sublime is enough to update?

doug

Restarting Sublime Text should be sufficient though I’ve heard that some people have to remove and reinstall the plugin to get it to update. I’m looking into this.

The internal version numbers should now match the ones I’ve been referring to in my posts.