Simon Gregory http://blog.simongregory.com Flash, Flex and TextMate Fri, 26 Feb 2010 15:32:43 +0000 http://wordpress.org/?v=2.9.2 en hourly 1 Moving the Ant.tmbundle http://blog.simongregory.com/02/moving-the-ant-tmbundle/ http://blog.simongregory.com/02/moving-the-ant-tmbundle/#comments Wed, 10 Feb 2010 23:23:50 +0000 Simon http://blog.simongregory.com/?p=208 Initially I set out with the aim to switch from Subversion to Git before there was an official plan from the TextMate crew. This has now changed, and all bundles that show Github activity are being removed from the TextMate svn repository. Which means that the official bundles I mirrored now have a duplicate Github mirror, and one that is more central for TextMate users and should be the root of all development. The Apache bundle was easy to sort, as there were no forks I could simply delete my copy. The Ant bundle wasn’t so straightforward.

Theoretically there’s no reason why two mirrored repositories couldn’t be used as each can be added as a remote. But because of their independent initialisation against the svn repo their histories aren’t identical this doesn’t work correctly in practice. Even though the file contents are identical at each commit git still recognises separate commits because git-svn appends unique metadata. So you end up with a lot of messy duplication in the history tree.

The fastest solution is to rebase one mirror into the other. Public rebasing isn’t the done thing as it’s bad practice to be changing the repository history when others could be working against it. However in this case we are looking to retire one history completely. I think, given that there’s only a little work in the forks, and the file content is the same it is the right solution.

So here are the steps I took to merge my mirror into the official one

  • Forked and cloned the official bundle on github
  • cd‘d to the root of the clone
  • Added new remote using git remote add old-origin git@github.com:simongregory/ant-tmbundle.git
  • Fetch the remote data git fetch old-origin
  • Created old-master branch from the old-origin/master with git br old-master old-origin/master
  • Checked out old-master git co old-master
  • Rebased old-master onto master using git rebase master
  • Switched back to master git co master
  • Merged master with old-master git merge old-master
  • Deleted the old-master branch git br -D old-master
  • Created new sg branch git co -b sg
  • Cherry picked the one commit I needed git cherry-pick 91f598
  • Pushed the branch git push origin sg
  • Removed the old-origin remote using git remote rm old-origin

Then to linked to the official TextMate remote using

  • git remote add tm git@github.com:textmate/ant.tmbundle.git
  • Fetched the remote data git fetch tm
  • Checked master out git co master
  • Synced master branches by pushing git push tm (only possible if you have write access)

One extra thing to note is the change from the old naming convention using a hyphen to a period.

There’s likely to be a better way of achieving this, but this is what worked for me. It won’t work if you have any private branches as you wouldn’t be able to pull them across. In this case I’d look at inverting the process and adding the new fork as a remote to the existing repository and merging from there.

]]>
http://blog.simongregory.com/02/moving-the-ant-tmbundle/feed/ 0
Going Git http://blog.simongregory.com/02/going-git/ http://blog.simongregory.com/02/going-git/#comments Tue, 24 Feb 2009 00:22:49 +0000 Simon http://blog.simongregory.com/?p=126 Git is one of the tools I’ve been meaning to try for a while now. It’s a version control systems that offers a distributed model, is fast, light and perfect for branching and merging.

I was pretty confident I’d be up and running quickly with git as I’m used to subversion. But given the past few days experience I wouldn’t say it’s been easy. It may have been, but I decided my way in would be to mirror both the Flex and ActionScript 3 TextMate Bundles over on github – which meant using git svn. In principle it looked straightforward, but after a few clumsy maneuvers I was quickly disorientated (mainly because git svn dcommit happens to rebase on the quiet). I don’t think I’m out of the woods yet but am really beginning to see what all the noise over git is about. It’s well worth the initial steep learning curve.

What I’m hoping to see are forks of the bundles, new features, feedback, and maybe one or two bug fixes ;) There are some branches to try as well. One or two build solutions have been cooked up but not quite finished. Alongside a basic attempt to integrate fdb, but it still needs a UI bolting on the front to offer true integration.

Oh, and for those of you who’ve been waiting for the auto-completion alpha then that’s in the main bundle now. Take a look at the ‘Auto Complete’ command – I’ll post a little more about it soon.

]]>
http://blog.simongregory.com/02/going-git/feed/ 16
Improved Auto Import for ActionScript 3 in TextMate http://blog.simongregory.com/02/improved-auto-import-for-actionscript-3-in-textmate/ http://blog.simongregory.com/02/improved-auto-import-for-actionscript-3-in-textmate/#comments Wed, 18 Feb 2009 13:28:00 +0000 Simon http://blog.simongregory.com/?p=120 The ActionScript 3 bundles had the ability to auto import a class for a long time, but the functionality has been limited to the area of the document between the package and class declarations. There have been some interesting solutions to improve this workflow, but ultimately it needed a more elegant solution.

If you grab the most recent version of the bundle you’ll now find that ⇧⌘I can be invoked from a wider scope and will present you with a list of possible classes to import based on the current word. Select one and an import statement for the class will be generated and injected into the document (or a tooltip saying the class is already imported).

I ought to stress that the importing is improved, but needs more work. The command is scoped to work within a public class, so any private classes hiding beneath your package block won’t benefit. You’re also likely, if you’re tidy, to want to organise the imports statements later on. But what is great about this is it let’s you skip a repetitive task and focus on higher level logic.

]]>
http://blog.simongregory.com/02/improved-auto-import-for-actionscript-3-in-textmate/feed/ 28
AS3 Autocompletion in TextMate http://blog.simongregory.com/09/as3-autocompletion-in-textmate/ http://blog.simongregory.com/09/as3-autocompletion-in-textmate/#comments Fri, 26 Sep 2008 16:37:20 +0000 Simon http://blog.simongregory.com/?p=102

Here’s a little teaser showing autocompletion for ActionScript 3 in action using TextMate.

It’s work in progress and I’m planning on releasing it for testing once Dialog 2 moves out of review. I also need to add the functionality to search multiple ancestors in interfaces to resolve the type of an item.

]]>
http://blog.simongregory.com/09/as3-autocompletion-in-textmate/feed/ 53
TextMate JavaScript Flash Bundle http://blog.simongregory.com/07/textmate-jsfl-bundle/ http://blog.simongregory.com/07/textmate-jsfl-bundle/#comments Thu, 31 Jul 2008 16:33:56 +0000 Simon http://blog.simongregory.com/?p=36 I’ve quickly put together a bundle for working with JSFL, or the Flash JavaScript API. If you’re not familiar with JSFL it is used to automate and extend the Flash IDE. The bundles language grammar relies on the JavaScript bundle being installed (which is one of TextMates default bundles) as it extends it and adds all of the JSFL objects, methods and properties. You also get:

Run (⌘R)

Runs the current document in Flash.

Documentation (⌃H)

Searches the documentation and presents a list of matches. As I only have access to machines with Flash CS3 installed I don’t know the alternative paths to the documentation previous (and later) versions of Flash use so please drop me a line and I’ll include them.

Auto Complete Method / Property (⌥⎋)

Provides a pop-up list of the available method and property completions based on the current word.

I’d recommend checking out the bundle from here for the most up to date version, otherwise you can download it as a zip here.

JSFL Bundle

]]>
http://blog.simongregory.com/07/textmate-jsfl-bundle/feed/ 5
Apache Bundle Upgrade http://blog.simongregory.com/02/apache-bundle-upgrade/ http://blog.simongregory.com/02/apache-bundle-upgrade/#comments Mon, 11 Feb 2008 22:23:21 +0000 Simon http://blog.simongregory.com/02/apache-bundle-upgrade/ The Apache bundle, which I originally contributed in the early days of TextMate, was due an upgrade. So I’ve made a few improvements…

Start, Stop, Restart and Graceful commands (⌘R)

These commands, which all target apachectl, are now bound to ⌘R under the source.apache-config scope which makes it more convenient to directly control httpd from TextMate.

As apachectl requires sudo privileges I used applescript for authentication. For reasons only known to Apple the password request dialog would launch but not get focus – leaving you to reach for the mouse to target the input field. Moving away from the keyboard is slow so this was something that really annoyed me. I’ve now switched to using the excellent tm_dialog system which makes things much smoother.

It is also possible to store your admin password in your Keychain, this is done by selecting the “Add to Keychain” toggle in the password request dialog box. I’m more than happy with the security implications of this as I’m fairly good at keeping my machines locked. If you do choose to do this then the command line security app will have access to the keychain item and is the only way someone could gain access.

Documentation (⌃H)

This now searches a documentation index file for the current word/selection then redirects or presents a list of matches as appropriate. If you appear to have the documentation installed locally then the script favours it over the apache website.

Open Include (⇧⌘D)

The language definition has been improved to add a scope for Includes. Using the key combination apple-shift-D on this scope opens the file referenced by the inlcude, or directory if it is wild carded.

Open Config… (⇧⌘C)

Previously there were various commands to open the apache.conf files these have now been consolidated into one command which searches the apache install directory, either /etc/apache2 or /private/etc/httpd depending on your version of OS X and the /users, /extra and /other subdirectories. All the conf files found are presented in pop-up from which one can be choosen to open.

Bundle Configuration

It is now possible to override the default bundle behaviour by setting the following environmental variables. TMAPACHEDIRECTORY, TMAPACHEACCESSLOG, TMAPACHEERRORLOG and TMAPACHEMANUAL_URI all allow the custom targeting of files and directories. See the bundle help for a detailed explanation.

]]>
http://blog.simongregory.com/02/apache-bundle-upgrade/feed/ 2
Open Bundle as Project… http://blog.simongregory.com/01/open-bundle-as-project/ http://blog.simongregory.com/01/open-bundle-as-project/#comments Wed, 02 Jan 2008 10:30:13 +0000 Simon http://blog.simongregory.com/01/open-bundle-as-project/ Open menu is long winded. To speed up the process here’s a small command which searches the default bundle locations and presents all the bundles in a dialog. Pick [...]]]> I’m often opening the bundles I develop – and nosing through the others – as projects, and doing so via the Finder or the File > Open menu is long winded. To speed up the process here’s a small command which searches the default bundle locations and presents all the bundles in a dialog. Pick the one you’re interested in and TextMate opens it as a project. That’s if it’s enabled, when it’s not the default behavior is to enable it, second time round it will open as a project.

Download

]]>
http://blog.simongregory.com/01/open-bundle-as-project/feed/ 0
HelvectorLight Theme http://blog.simongregory.com/12/helvectorlight-theme/ http://blog.simongregory.com/12/helvectorlight-theme/#comments Sun, 23 Dec 2007 00:28:11 +0000 Simon http://blog.simongregory.com/12/helvectorlight-theme/ I’ve just updated the ActionScript 3 Bundle to include an ASDoc language definition. This is essentially a scope change of Luke Daley’s JavaDoc language definition. The result is that the following scopes within the documentation blocks are brought under new colour jurisdictions.

keyword.other entity.name.tag punctuation.definition.tag

For me, using my favourite theme – Twilight – the extra colour where I was so used to seeing grey wasn’t working. To combat it, and get things greyscale again, I added 3 new theme elements and applied them to the following scopes:

comment.block.documentation keyword.other comment.block.documentation entity.name.tag comment.block.documentation punctuation.definition.tag

The results are the HelvectorLight.tmTheme which calms things down again.

Download

]]>
http://blog.simongregory.com/12/helvectorlight-theme/feed/ 2
Installing the Debug Flash Player on Multiple User Accounts http://blog.simongregory.com/12/installing-the-debug-flash-player-on-multiple-user-accounts/ http://blog.simongregory.com/12/installing-the-debug-flash-player-on-multiple-user-accounts/#comments Sat, 15 Dec 2007 15:08:11 +0000 Simon http://blog.simongregory.com/12/installing-the-debug-flash-player-on-multiple-user-accounts/ I share one of my development machines with another flash developer and have run into a problem whereby the debug flash player was only available to the user who installed it. Trying to set more generous permissions on the plug-in didn’t work. So I simply changed the name of the plug-in by prefixing it with the installing users name then reinstalled it as second user. This leaves you with multiple instances of the flash player in Library/Internet Plug-Ins but as each user only has permission to use the player they installed no confusion arises.

The most recent debug player can be found here. An archive of debug players can be found here.

]]>
http://blog.simongregory.com/12/installing-the-debug-flash-player-on-multiple-user-accounts/feed/ 0
TextMate Ant Bundle http://blog.simongregory.com/10/textmate-ant-bundle/ http://blog.simongregory.com/10/textmate-ant-bundle/#comments Tue, 30 Oct 2007 22:40:03 +0000 Simon http://blog.simongregory.com/10/textmate-ant-bundle/ Following on from my work with the Apache, ActionScript, ActionScript 3 and Flex TextMate Bundles, comes a bundle for the Ant build system. It is available for checkout here which I’d recommend for the most up to date version, or download as a zip here.

Ant Bundle

]]>
http://blog.simongregory.com/10/textmate-ant-bundle/feed/ 2