So, is anyone using Sublime Text 2 with Corona SDK? ST2 can use TextMate Bundles.
I’ve been googling for 2 days now, and simply can’t get CMD+B to launch Corona Simulator.
I’m on OSX 10.8.2. Has anyone tried to get this to work?
So, is anyone using Sublime Text 2 with Corona SDK? ST2 can use TextMate Bundles.
I’ve been googling for 2 days now, and simply can’t get CMD+B to launch Corona Simulator.
I’m on OSX 10.8.2. Has anyone tried to get this to work?
I use ST2, but I’ve never taken the time to try and get CMD-B to work. I just want that error message on startup to go away.
I use Sublime Text 2, its quite easy to get it to build with Corona.
In ST2, go to Tools > Build System > New Build System and paste the following, then save:
{ "cmd": ["/Applications/CoronaSDK/Corona Terminal", "main.lua"] }
If you have not stored Corona SDK in your applications folder, you will need to amend it to the file path you saved it in.
Rob - What error message are you talking about?
EDIT:
Or, if you want to install this: https://github.com/drowne/Corona-Sublime which includes build system and auto-complete for many of the API’s, open Terminal and paste these two commands:
2) git clone https://github.com/drowne/Corona-Sublime.git
“Error loading meta info: Expected key scope”. Admittedly I’ve not looked in the past 6 months to see if there is a fix for this, but it has something to do with the Corona bits. Though it seems people may have figured it out. Let me see if I can make it work.
BTW: The build system works wonderful, though I see two corona icons in my doc, dunno why?
EDIT: Fixed the stoopid scope error that’s been plauging me for a long time.
cd ~/Library/Application Support/Sublime Text 2/Packages/Corona-SDK
vi Completions.tmPreferences (or use the editor of your choice, perhaps Sublime 2?)
Add:
<key>scope</key>
<string>source.lua</string>
after:
<key>name</key>
<string>Completions</string>
Problem solved.
The only problem with the ST2 build system is that every time you build it opens a new corona window. I should really tweak it to close any existing simulators?
Maybe remove your corona bundles and reinstall from the github link i posted? (backup first of course) it sounds like one of the files it tries to load has some syntax error.
Actually, that’s the first thing I tried. But it doesn’t work. At least in my case. And yes, corona is stored in the default location. I found a lot of examples online that setting up build system like you described doesn’t work for most people
But it does for some. Why is that? I doubt anyone could answer this question
Ok, just managed to get it to work. And by using this method it doesn’t launch new Corona Simulator every time you hit CMD+B. Here is the build system:
{ "cmd": ["/Applications/CoronaSDK/Corona Simulator.app/Contents/MacOS/Corona Simulator","$file\_path"], "selector": "source.lua" }
And managed to get tmbundle to work, craftydeano posted it above. But it’s rather old, so I doubt it has the newest API autocompletion?
c0ppo, just tried your method on my Mac (10.8.3) and it’s good news/bad news.
It does work - previous solutions to this problem require copying over the “simulator” file from old Corona SDK installs that for some reason Corona Labs dropped from the build earlier this year.
Despite what you said it clearly does not block launching new simulators. (I just tried it)
The big problem with this method is that you *cannot* build anywhere except the root directory. Attempting to build from any other folder (maybe you have a “logic” subfolder in your project or something similar) will just result in an error message from the SDK, which basically means something about how ST2 is sending the path is faulty with that command line.
(To be fair, my method has the same problem. But I haven’t found a way to fix it.)
In my case it does. Only one simulator launched, and when I click on CMD+B new simulator opens, and old closes down :S
Haven’t really tried this. I just experimented by launching sample apps, and they all work normal. I’m gonna make a small app using subfolders and test it out and then report here.
Same thing here. But it’s one year old. If I get some free time, I’m gonna try to update that bundle. It’s really a shame that probably that probably the most popular text editor doesn’t have a corona SDK package
I would make my own and publish it, but my python skills are zero to none
I use Sublime both on Windows & Mac w/ Corona SDK.
The CoronaSublime plugin is useful, but not really needed as you can make your own build configuration pretty easily and it doesn’t have full code intel as many are missing.
It is slightly different dependent if you are on Windows or Mac.
The bundle does not use Python, it’s just a bunch of snippets and so on.
It’s very easy to edit and bring up to date, just time consuming.
What version of SublimeText2 are you using? Maybe it’s version specific. I’m not using Version 3 Beta yet.
The autocomplete stuff is a shame; if I could figure out the syntax I would update that. I’ll try to look closer. One flaw in the autocomplete system though is that it does not seem tolerant of pre-typing, that is, typing
“display.newI” will trigger the autocomplete for “display.newImage”, but when you accept it, it becomes “display.display.newImage” because it can’t handle the library prepack.
cspence: I can’t really agree on the build system. Last time I looked the documentation was little to none and there was nothing in it to suggest solutions to multi-client or subfolder pathing.
I use ST2 and ST3 beta side by side.
I haven’t found anything about the pathing either, I just go to the a top tier file and hit control/command b.
I don’t think there currently is a way.
Here this will fix one of your problems.
Put this in the build file.
“working_dir”: “${folder}/”,
This will allow you to hit control/command B from any where in your project and it will always run main.lua in the root folder.
Thanks for trying but that line has no effect on my build. Same problem.
“The folder “data” could not be opened. Corona Simulator only accepts folders containing a main.lua file.”
(ST2 v2.0 build 2210)
Works for me.
This is my windows build file:
{ "working\_dir": "${folder}/", "cmd": ["C:\\Progra~2\\Corona~1\\Corona~1\\corona~2.exe", "main.lua"], "selector": "source.lua", "shell": true }
Tested in both ST2 & ST3, it works great.
Indeed. I already slightly edited tmbundle.
But I’m not talking about bundles. I’m talking about corona package
I am talking about the Corona package as well, not all plugins actually use python, some are just snippets and commands.
These will work fine in ST3 without any editing. CoronaSublime plugin is one of those plugins.
Although I had some issues with the build command in ST3, but when I manually created a new build command, it worked fine.
Editing and adding all API’s to current tmbundle isn’t really a problem. Check it out, it’s quite simple actually. But quite annoying as well