Corona Bundle for TextMate

33 replies [Last post]
Ludicrous Software
User offline. Last seen 9 weeks 2 days ago. Offline
Joined: 1 Jul 2009

Hi,

If you use TextMate to code your Corona apps, you may be interested in checking out the Corona Bundle for TextMate that I've made available. It basically extends the existing Lua bundle to add support for Corona-specific keywords in autocomplete, as well as a number of snippets for common Corona functions. I'm adding more keywords and snippets as I go along. You can get more info here:

http://www.ludicroussoftware.com/corona/corona-bundle-for-textmate/

Feedback/suggestions are welcome!

Thanks!
Darren

Replies

Magenda
User offline. Last seen 4 weeks 5 days ago. Offline
Joined: 2 Jul 2010

Darren, you are my hero! :)

I have just abandoned Xcode and I am getting used to TextMate, which has some excellent features for code authoring. What intrigued me mostly in TM was the code snippets feature, which I suspected would give a solution for autocompletion in Corona projects.

My intention was to write snippets for commonly used code blocks (such as event handlers) as a generic base which I could then extend with specific-purpose code. However, I am slow at this, as I am learning Lua at the same time :)

Your bundle, is going to help me very much!
I am also going to share whatever useful comes out from my attempts.

Thanks again!

Magenda
User offline. Last seen 4 weeks 5 days ago. Offline
Joined: 2 Jul 2010

Just to add that command-R is not working here for some reason. I've installed Corona where the tmcommand file also says.

Ludicrous Software
User offline. Last seen 9 weeks 2 days ago. Offline
Joined: 1 Jul 2009

Hi Magenda,

Not sure why it wouldn't be working for you, but in any event I'll be making some changes to that part of the bundle over the weekend. Perhaps the new version will fix the problem you're experiencing.

Thanks,
Darren

Danro
User offline. Last seen 3 years 22 weeks ago. Offline
Joined: 8 Oct 2010

Just wanted to give you guys an update. I've been helping out on the TextMate bundle, and you can find my branch here on GitHub:

http://github.com/danro/Corona-SDK.tmbundle

I've reworked the "Run Simulator" command, so that it both launches and reloads the current simulator using a single command.

IndeedYes08
User offline. Last seen 2 years 12 weeks ago. Offline
Joined: 12 Oct 2010

I am having an issue installing the bundle.

TextMate is not in my Application Support folder (looked in both, no where to be found).

I am currently only using the trial version and would like to know if that is my problem? Not sure what im missing!

Thanks in advance!

Ludicrous Software
User offline. Last seen 9 weeks 2 days ago. Offline
Joined: 1 Jul 2009

If there's no TextMate/Bundles directory in your Application Support directory, you can create those manually. TextMate should pick up any bundles installed in that directory when it starts up.

Thanks,
Darren

dweezil
User offline. Last seen 31 weeks 4 days ago. Offline
Joined: 23 Sep 2010

Running the simulator does work for me either. I get

Last login: Sun Nov 21 11:40:21 on ttys003
/Applications/CoronaSDK/simulator /Users/rupert/Documents/dev/KeePeeUppy/source
Rupert-Hawkess-Mac-mini:~ rupert$ /Applications/CoronaSDK/simulator /Users/rupert/Documents/dev/KeePeeUppy/source
-bash: /Applications/CoronaSDK/simulator: No such file or directory
Rupert-Hawkess-Mac-mini:~ rupert$

ksan
User is online Online
Joined: 29 Nov 2010

Command-R triggers XCode for me since there is a XCode Bundle provided by TextMate. It appears that the bundles provided by TextMate have higher priority over user supplied ones. I realize I can delete the XCode Bundle but I do not wish to do this yet in case I occasionally use XCode as well. Will need to figure out how to disable a bundle or change order of prioritization. Has anyone been able to resolve this issue? Thanks

Edit - I found a way to Hide a bundle using the Bundle Editor - Filter option and now Command-R triggers the Corona SDK but it just brings the SDK up and does not start the app as its seen in some of the ANSCA demos. Ok, one step at a time.

Ludicrous Software
User offline. Last seen 9 weeks 2 days ago. Offline
Joined: 1 Jul 2009

Hi ksan,

By any chance does the path to your project directory contain a space in it? e.g.

"/path/to/folder/Hello World" ?

It looks like there's a bug in the simulator launch code caused by spaces in the directory names. The easiest fix is to remove the spaces. I'm looking into the bug right now, and will post a fix when I have one.

Thanks,
Darren

ksan
User is online Online
Joined: 29 Nov 2010

Hi Darren,

Thanks for your quick response. You are absolutely right! I did have spaces in there. I tried Command-R on a project that does not have spaces in the path and it worked as expected. Brilliant. Thanks for all your hard work.

Regards,
KS

jhocking
User offline. Last seen 1 year 49 weeks ago. Offline
Joined: 4 Dec 2010

Has anyone done a Corona extension like this for TextWrangler? If not I might do one. I don't know if TextWrangler does auto-complete and anyway I don't care, but having syntax highlighting for Corona commands would be really helpful.

Ludicrous Software
User offline. Last seen 9 weeks 2 days ago. Offline
Joined: 1 Jul 2009

Just a quick update: I've created a dedicated page for the TextMate bundle where I'm posting news of updates to the bundle, etc.

Latest additions include code colouring - if you've tried it out let me know what you think, or if I missed any keywords that should get the code colouring treatment.

Thanks,
Darren

Ludicrous Software
User offline. Last seen 9 weeks 2 days ago. Offline
Joined: 1 Jul 2009

Hi Everyone,

Just wanted to let you know that I've just finished a whole bunch of updates to the bundle:

  • Updated some of the snippets that were out-of-date due to changes in the Corona SDK.
  • Added a bunch of new snippets, mainly for the media package
  • Started to organize the bundle menu into a set of submenus, grouping snippets by package.
  • Added parentheses to many of the functions in the completions list if the function does not take any arguments (e.g. the completion is now 'stopTuner()' instead of 'stopTuner', so you don't have to type those parentheses anymore).
  • Sorted the completion list alphabetically, and put full package paths at the end of the completion list.

As I mentioned earlier, visit this page for all the bundle info you could possibly want.

Thanks,
Darren

PeterBailey
User offline. Last seen 1 year 17 weeks ago. Offline
Joined: 10 Jan 2011

Thanks a lot Darren. This bundle is great. Much appreciated.

khovanes
User offline. Last seen 3 years 38 weeks ago. Offline
Joined: 17 Jan 2011

It appears there might be a naming issue with the Simulator path.... I had to move the last version I pulled from Anscamobile from the .243 directory to the path specified within the bundle (or vice versa) /Applications/CoronaSDK/simulator

Ludicrous Software
User offline. Last seen 9 weeks 2 days ago. Offline
Joined: 1 Jul 2009

That's right. At the moment, the bundle doesn't support setting an environment variable for the SDK path. It's on the to-do list, though.

Darren

txmarsh
User offline. Last seen 2 years 37 weeks ago. Offline
Joined: 17 Jan 2011

Sorry for the newbie question but would it be complex to port this over to textwrangler? Are they sufficiently different programs that this would not be possible?
thanks!

Ludicrous Software
User offline. Last seen 9 weeks 2 days ago. Offline
Joined: 1 Jul 2009

@txmarsh: no idea, as I don't know what kind of bundle (or whatever it might be called) support TextWrangler has. The TextMate bundle is open source, so feel free to grab it from GitHub and give it a try.

Thanks,
Darren

PeterBailey
User offline. Last seen 1 year 17 weeks ago. Offline
Joined: 10 Jan 2011

Hey txmarsh.

I don't use textwrangler, but the link here says it supports syntax highlighting. Maybe that is what you want?

http://lua-users.org/wiki/LuaEditorSupport (scroll about 1/2 down page)

Cheers,

Peter

Ludicrous Software
User offline. Last seen 9 weeks 2 days ago. Offline
Joined: 1 Jul 2009

Hi All,

I've added some very simple templates and snippets for the various audio methods to the bundle. Slightly more detail here.

Thanks,
Darren

PeterBailey
User offline. Last seen 1 year 17 weeks ago. Offline
Joined: 10 Jan 2011

Cool. Thanks again Darren.

acrowne
User offline. Last seen 2 years 31 weeks ago. Offline
Joined: 21 Oct 2009

I am trying to use the Check Syntax button in your bundle and it gives an error that it can't locate luac. I can't either, and I'm wondering if that is something I have to install separately.

Thanks,
Adrian

traustitj
User offline. Last seen 29 weeks 2 days ago. Offline
Joined: 16 May 2011

Where I pick which bundle I want to use, I can't see the Corona SDK, but in the Action menu I do, so I can never use any ESC code completion, any ideas ?

I did install the Textmate Lua bundle, but I have since removed it, but Lua is still there.

Not understanding, anyone ?

Ludicrous Software
User offline. Last seen 9 weeks 2 days ago. Offline
Joined: 1 Jul 2009

Hey everyone,

Just added a bunch of new stuff to the bundle. Check out this page for the details:

www.ludicroussoftware.com/corona-textmate-bundle#29July2011

Thanks!
Darren

Ludicrous Software
User offline. Last seen 9 weeks 2 days ago. Offline
Joined: 1 Jul 2009

Hi again,

If you install the SDK to a non-default location, or need to run multiple versions of the SDK, you can now specify the location of the SDK on a per-project basis and the 'Run in Simulator' command will pick up that setting. Grab the latest version of the bundle, and check out this blog post explaining how to set it up:

http://www.ludicroussoftware.com/blog/2011/08/03/custom-corona-sdk-locations-for-textmate-bundle/

Thanks,
Darren

captain_cowell
User offline. Last seen 32 weeks 54 min ago. Offline
Joined: 11 Apr 2011

Hi Darren,

Just wanted to show my appreciation for the bundle as I have been using it for 8+ months now and loving every minute of it. It really turns TextMate into an amazing IDE for Corona.

One quick question though, is it possible to redirect the cmd-R to iTerm instead of Terminal? I've attempted modifying the bundle here:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
 
CORONA_SIM_PATH="/Applications/CoronaSDK/simulator"
 
# In order for the simulator relaunch to work, "Enable access for assistive devices" must be selected in System Preferences > Universal Access.
 
osascript <<- APPLESCRIPT
 
        on appIsRunning(appName)
                tell application "System Events" to (name of processes) contains appName
        end appIsRunning
 
        on selectAppMenuItem(app_name, menu_name, menu_item)
                 try
                 -- bring the target application to the front
                        tell application app_name
                                 activate
                        end tell
                        tell application "System Events"
                                tell process app_name
                                        tell menu bar 1
                                                tell menu bar item menu_name
                                                        tell menu menu_name
                                                                click menu item menu_item
                                                        end tell
                                                end tell
                                        end tell
                                end tell
                        end tell
                        return true
                        on error error_message
                        return false
                end try
        end selectAppMenuItem
 
        if appIsRunning("Corona Simulator") then
                selectAppMenuItem("Corona Simulator","File","Relaunch")
        else
                tell application "Terminal"
                do script "$CORONA_SIM_PATH $TM_DIRECTORY"
                end tell
        end if
 
APPLESCRIPT

by swapping out the "tell application "Terminal"" to "tell application "iTerm"" but it doesn't appear to work. Do I need to take other steps?

Thanks again for the amazing bundle... cheers

Jack01
User offline. Last seen 36 weeks 5 days ago. Offline
Joined: 11 May 2012

Hi!

Thanks a lot for the bundle.

Textmate 2 has just been released as open source on GitHub. That means you can use it free!
If you don't feel like compiling yourself the Textmate source, I found a ready to use compiled version here http://burgua.org/post/29064784750/open-source-textmate-2
It works great and even auto updates.

For installing the Corona bundle I did the following. In terminal go to /Applications/TextMate.app/Contents/SharedSupport/Bundles

There enter

1
git clone https://github.com/osadchuk/Corona-SDK.tmbundle.git 

Restart Textmate and it shows up under Bundles.

If git command is not found in terminal, see fix --> http://www.hongkiat.com/blog/mountain-lion-git-fix/

DiCaver
User offline. Last seen 1 year 28 weeks ago. Offline
Joined: 17 Feb 2012

Hi,

I'm trying to put this Textmate Bundle on iPads text editor - Textastic ... http://www.textasticapp.com/v4/manual/lessons/How_can_I_add_my_own_syntax_definitions__themes_and_templates.html ... but no success. I'm Mac beginner, also iPad and Corona, so maybe I don't understand correctly - it is possible or not to combine this great bundle in to Textastic?

Thx, Marko

Antheor
User offline. Last seen 3 weeks 1 day ago. Offline
Joined: 22 Sep 2010

Hi jacco, thx for the tips using textmate2.

Everything worked fine, even the git trick, and my terminal ended with 'done'.

Still, I can't see the corona bundle in the list.

It seems the sdk.tmbundle is installed in my user folder, despite the /Applications/TextMate.app/Contents/SharedSupport/Bundles command in the terminal ...(?)

What should I do ?

( I guess I made a mistake updating to textmate2, I thought it would install a new software but it just crushed my textmate1, now everything is weird, some block comments are not seen thus destroy all my code .....;((

Jack01
User offline. Last seen 36 weeks 5 days ago. Offline
Joined: 11 May 2012

Hi, maybe try to delete everything, incl. your user settings by using Appcleaner and reinstall.

Antheor
User offline. Last seen 3 weeks 1 day ago. Offline
Joined: 22 Sep 2010

Ok.
I unsinstalled.

I'm under 10.7.4

I have to open the terminal, copy paste
/Applications/TextMate.app/Contents/SharedSupport/Bundles

Then copy paste
git clone https://github.com/osadchuk/Corona-SDK.tmbundle.git

right ?

Jack01
User offline. Last seen 36 weeks 5 days ago. Offline
Joined: 11 May 2012

No lol, go to the folder /Applications/TextMate.app/Contents/SharedSupport/Bundles by typing in terminal

cd /Applications/TextMate.app/Contents/SharedSupport/Bundles

and than make a clone via the git command.

Antheor
User offline. Last seen 3 weeks 1 day ago. Offline
Joined: 22 Sep 2010

OK, steps are ok now but a strange thing occurs :

After your lines, I open textmate2, and I can see in bundles menu "corona sdk" (but nothing in prefrences/bundles)
I open a .lua file, it asks me to associate with lua, installs 2 bundles, and pooff ! corona sdk bundle disappears ... (nothing in preferences/bundles nothing in bundles menu)

So I made a direct copy of the bundle to Application Support/Textmate/Managed/Bundles, now I can see it :)

Viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.