Anyone Using Sublime Text 2?

Wouldn’t know, coz I never even tried to do anything else with ST2 other than installing additional packages. One of the reasons is python, but now I’m gonna check it out at least :slight_smile:

And once again, it’s really a shame there isn’t a simpler solution for using corona with ST2. ST2 is quite powerfull, and it’s popularity is growing exponantionally.

It takes two seconds to use Corona with Sublime, just make a New Build System, cut/paste the code I put up there (if using Windows) and it works great.

You don’t get code insight for Lua or Corona API though, this you need Corona Sublime Plugin for, but it isn’t up to date or complete, neither is the TextMate version it is based on.

I use Sublime daily, it works great with Corona, the right plugins makes it much closer to an IDE environment.

In fact, I’ve tried all the Corona IDE’s and they all suck, when it comes down to it, I figured they are all third party IDE’s made to work with Corona, basically a text editor with some half ass stuff strapped on.  So why not just use the best editor you can, and strap the stuff on yourself.

Right now it works great for me, I’d love to have full complete syntax highlighting with Corona, but I manage without it.  I’m also using it to check code in and out of git within sublime.  Once you set it up, it works amazingly well.

I’m already using corona with sublime. But I don’t think you got my point at all :slight_smile:

Lack of autocompletion for newer API’s, some have problems with CMD+B, etc. And sublime is quite powerful, and it’s a shame if we can’t use it full width.

Maybe the problem is in my English, so if I’m not explaining myself well, I apologise.

I told you I agreed about the lack of full api, but I find it a small problem.

Problems with Command B is most likely configuration problems on their end, not Sublime.  I have converted 10+ people to Sublime w/ Corona and helped them all get their build settings, none of them had problems once it was setup right.

Not sure what you mean about full width, so I cannot comment here.

As for the full api, someone would need to take charge of this, the person who does the Sublime version of it no longer is updating it.  The Textmate version it was based on hasn’t been updated in a long time.  Corona Labs isn’t likely going to do it as most users are not going to use an editor like Sublime.  I do it, but it is far too much work than I care to do and I am not sure I will still be using Corona.

How about we all chip in and all add the API’s?

The majority of the API’s are there already, we can just fork the existing project and add to it?

I already forked it myself as I was considering doing it.  But it would take some time to see what’s missing and what wrong.

It’s also changing very frequently with each build, it wouldn’t take long (like a week) for it to be out of date.

It’s really a big project, especially initially.

Hmm, good point. Maybe if it was only kept upto date with the public builds?

Better but still a huge project for anyone but Corona Labs employee as you have to make sure none of the existing API changed.

You could get fancy and put the entire docs into a VCS and look for differences, but it is still very time consuming and not reliable.

Didn’t take too much time to scrape a list of the API functions:

https://gist.github.com/anonymous/d79e403ddc7e19eb9466

Just need to find a nice way to convert the list into a textmate2/ST2 bundle (something I’ve never done)

Oh, and is Sublime Text 3 beta worth upgrading too? I haven’t really looked into it since it was announced. 

ST3 is problematic and doesn’t offer much over ST2.  I’d wait.  I run them both and have about 80% of my plugins working in ST3.

ST3 is a lot faster, but that’s pretty much it.  It’s more of a way to get some more money coming in than anything else.  They sped it up, added like 3 minor features, yet it breaks the entire plugin ecosystem as they now all have to be adapted to Python 3 which is a bit different than Python 2.6.

Where did you scrape the API list from?

It would be a bit of work to make these as the syntax is something like this:

<?xml version=“1.0” encoding=“UTF-8”?>

<!DOCTYPE plist PUBLIC “-//Apple//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”>

<plist version=“1.0”>

<dict>

    <key>content</key>

    <string>addEventListener("${1:event_name}", ${2:function})</string>

    <key>name</key>

    <string>addEventListener</string>

    <key>scope</key>

    <string>source.lua</string>

    <key>tabTrigger</key>

    <string>addEventListener</string>

    <key>uuid</key>

    <string>CD4C09C5-A81D-444A-89F2-FE2B332B4FF1</string>

</dict>

</plist>

You can run a diff against the old and new file to get some idea of them, but still a bit of work to make these.  The diff in this format against the old list, would help narrow down the changes.

This is the problem; at the risk of sounding like a jerk (really, I apologize if it comes off like that) but the OP and my comment are both based on using OSX , not Windows. Directory fudging like ~1 specifically doesn’t work on the platform, and all of the “this is not working” comments you’ve seen in this thread are specifically based on problems getting OSX to work with those arguments.

Specifically with a fresh 10.8.3 install, subdirectory building and preventing multiple Corona Sim clients from launching do not work with that build string, which implies that something else needs to be set.

I’ll stick to ST2 if that’s the case.

I got the API list from Lua Glider IDE, it downloads the raw corona .lua files for its own autocomplete.

That syntax is a bit of a pain for autocomplete, I’ll take a look. May be easier to build it from scratch if I can automate it somehow?

It does work, I use it on Windows mostly, but I have a Mac build machine that it works fine.

Of course this is windows syntax, and the reason for the ~1 stuff is because once you add “shell” (so you can see the output of corona terminal) you cannot use long file names and have to use 8.3 file names.

I don’t have my mac on in front of me, but for a mac it is something like this:

    “cmd”: ["/Applications/CoronaSDK/Corona Terminal", “main.lua”]

It does work though, as I use it on another machine and a lot of my friends use it on OSX without problems.

In fact, my recent version of my build file is now mac/windows complaint and will shell a command based on which OS your in.

I can write a bot that transcribes it into a different syntax, but would need to look at it closer, I just don’t think it is worth the time involved, at least for me.

I don’t have my mac on in front of me, but for a mac it is something like this:

    “cmd”: ["/Applications/CoronaSDK/Corona Terminal", “main.lua”]

This is what works for me. If anyone is getting errors with this has error codes are you getting? 

I’ll just post my build settings so as not to be completely speaking out of the ether…

OSX 10.8.3 (AKA Latest) + SublimeText2 v2.0 2210 (which I think is more or less latest of v2)

Standard Corona SDK install (that is, to Applications/)

{ "working\_dir": "${folder}/", "cmd": ["/Applications/CoronaSDK/Corona Simulator.app/Contents/MacOS/Corona Simulator","$file\_path"], "selector": "source.lua" }

I’m more than happy to stand corrected on how that should work for OSX but so far that’s the best I can do (and for me the “working_dir” line has no effect thus far.)

Use this for the cmd line and see if you have better luck.
I can start up my mac later to check.

  “cmd”: ["/Applications/CoronaSDK/Corona Terminal", “main.lua”]

Build multiple times : multiple clients (same problem as before)

Attempt to open from a sub folder : “The document main.lua” could not be opened. Corona Simulator cannot open files in the “Lua Source Code” format." (same problem as before)

As a side note if you leave the “working_dir” line in while calling that modified “cmd” line, you can’t build at all. Even main.lua gives you the sub folder error message.

I’ll test it on a mac tonight.  On Windows it works fine, you can also use $ProjectDir but have to have a project.

That would be great, thanks. I’m not surprised it works fine on Windows as I don’t remember having much in the way of problems there, but OSX has been something of a black box to me as far as ST2 is concerned.