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.
Issues (0.8.9 with SublimeText 3 OSX Mavericks)
-
No support for display.* - no display library calls get autocomplete as best I can tell
-
No autocomplete for :setFillColor, :setStrokeColor on objects except if you’ve used the command already in the code file
-
No support for any sort of . property autocomplete (i.e.: .width and other default corona properties)
-
No support for autocomplete of setReferencePoint() or the various display. reference points.
-
No support for transition.*
-
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
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:
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.
-
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…
-
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.
-
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.