Unity JS TextMate Bundle?

Hi All TextMate users,

I’ve finally updated the TextMate Unity JavaScript bundle to support Unity 2.1.

Please back up the old one before installing this one, just in case! Also note to do a clean install of this bundle first remove the old one from /Users/yourName/Library/Application Support/TextMate/Bundles/ as TextMate seems to append when updating bundles… a bit annoying.

I’ve also added the first revision of code completion to the bundle. Start typing a word and hit Option+Escape and a list of functions/classes/enumerations will pop up. Unfortunately this is as close as it gets to auto code completion in TextMate 1.57. So hopefully when 2 is released they’ll have some kick arse approach! :wink:

It’s still a bit of a work in progress. I still need to add more function information to each function/class so you can then use “Documentation for Function Call (tool tip)”, Control-Option-Escape to get some info to help remember what properties that function is expecting.

I’ve also added a documentation link to Microsoft’s online API for looking up those useful .NET/Mono functions.

I’ve also cleaned up the syntax sets so that they work with the default TextMate syntax colours. Sorry to those who’ve already setup a nice colour set based of the old bundle.

[EDITED] Added support for Unity iPhone and for these helpful 3rd party utilities: AniMate and SpriteManager.

Enjoy.

37429–4436–$unity_javascript_841.zip (62.1 KB)

I just converted the Unity parts of Emanuel’s C# bundle to work with JavaScript. I also added a snippet for Debug.Log (log). Find the bundle here. Please let me know if anything needs fixing.

Ok, that sort of whet my appetite for snippet making, so I’ve added macros for Update(), FixedUpdate(), Start(), typed variables, RequireComponent and AddComponentMenu. It’s available at the original location.

cool thanks. I ended up making my own as well. I will look at yours and combine the best of both and post here.

Cheers.

[EDITED] See top post.

Cheers.

textMate’s not doing anything for me with the unzipped Unity JavaScript.tmbundle when I double click on it. :cry:

see above. hopefully that fixed it

cheers.

Now I get a error dialogue box at least …

Bundle is Corrupt
The bundle Unity JavaScript.tmbundle does not contain the required info.plist file (or that file is corrupt) and can therefore not be installed.
[Continue]

see above hopefully it works now…

[EDIT] it works. just tried it on a fresh install of TextMate.

:lol:

Yup, works fine now here too. Thanks! textMate now set as my default editor.

verfied working! huzzuh!

Yup, many many thanks Jon! I’ve been wanting to use TextMate as the editor since I bought it in the Macheist bundle. Superb! Hapy now.

How do you use the autocomplete?

Jeff

start typing the word, then hit the escape key.

Cheers.

Cool. Do you know how to get it to used the local documentation? I tried changing the path, but it comes up with a blank page.

Edit: got this from here:

ref=${TM_SELECTED_TEXT} 
UNITYDOC="/Applications/Unity/Unity.app/Contents/Documentation/Documentation/ScriptReference/$ref.html"

if [[ -f "$UNITYDOC" ]] 
   then [[ -n "$UNITYDOC" ]]  exit_show_html "<meta http-equiv='Refresh' content='0;URL=tm-file://$UNITYDOC'>" 
   else echo "No Unity documentation found for: $TM_SELECTED_TEXT" 
fi

It’s better in two ways: it uses the local docs, and it goes directly to the documentation rather than doing a search. Although maybe it should do a search if it can’t find the actual file. I’ll look into that.

Yes I know about the local documentation. The reason I changed it on my machine is because it didn’t always work reliably. So I changed it to the web version.

Cheers.

What’s better if you use TextMate instead of Unitron if you use it together with Unity?

One of the best features is the project wide find replace. It rocks. You cna also work within a project and outside a project at the same time, so you can for instance have the same car.js script open from 2 unity projects and clearly see and tell which is which.

Hmm okay is the find based on grep?

I don’t know… I didn’t write it… email the TextMate people.