Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Textmate Titanium Intellisense Auto Code Completion

On this URL,
http://developer.appcelerator.com/blog/2010/06/titanium-mobile-textmate-bundle.html

it says, following needs to be done;

make sure the Ruby JSON gem is installed: sudo gem install json

cd /Users/[your username]/Library/Application\ Support/TextMate/Bundles
git clone git://github.com/subtleGradient/JavaScript-Appcelerator-Titanium-
Mobile.tmbundle.git

reload your bundles or restart TextMate

Could somehow point me in the right direction as to where you do the "sudo gem install json"?

Terminal? if so, what path? Anything else I need to know?

Thanks

— asked September 30th 2010 by Haluk Karamete
  • code
  • completion
  • intellisene
  • textmate
0 Comments

5 Answers

  • Yes you would run that from the Terminal. You could use the ~ to go into your user folder without having to type in it like this.

    cd ~/Library/Application\ Support/TextMate/Bundles
    

    Then pull the bundle from github while still in Terminal

    git clone git://github.com/subtleGradient/JavaScript-Appcelerator-Titanium-Mobile.tmbundle.git
    

    Now make sure the bundle that was pulled has the file extension tmbundle or TextMate won't see it. In terminal do this

    ls -l
    

    And see if you have something like ti-mo.tmbundle in there. If you do, you are good to go. If not, locate the thing that you think is the bundle and rename it to ti-mo.tmbundle. Replace somefilename with the file that represents the item you just fetched through github.

    mv somefilename ti-mo.tmbundle
    

    Now In TextMate go to Bundles/Bundle Editor/Reload Bundles.

    At that point you try to get code completion by clicking option and esc. If you don't see a list related to Titanium pop up, you probably need to install the gem for JSON. You would also do this in the Terminal but the path doesn't matter because it should find the correct path on its own.

    sudo gem install json
    

    I have seen some notes that claim you may need to install json_pure if the json gem doesn't work for you. If that's the case, do this.

    sudo gem install json_pure
    

    Hope that helps

    — answered September 30th 2010 by John McKnight
    permalink
    4 Comments
    • Hey John.. I assume this works for you? I get code insertion like if I hit d+tab, etc.. but if I just type 'Ti.' I get nothing.. any suggestions?

      — commented September 30th 2010 by Critter
    • Don't know if you saw it Critter but my other post mentioned the intellisense.

      "In the bottom bar of your editor there should be an option for selecting the type of file you are editing. There should be an option called 'Titanium Mobile Javascript' Try picking that and see if code completion starts happening automatically."

      — commented September 30th 2010 by John McKnight
    • John,

      Thanks again.

      I took another path. I downloaded the titanium bundle right from the author's web site ( http://github.com/subtleGradient/JavaScript-Appcelerator-Titanium-Mobile.tmbundle ) and per his instructions re-named the downloaded folder to something.tmbundle and double clicked.

      This took care of the missing Application Support folder and the installing the bundle etc. Now the TextMate do recognize this bundle. But….

      As expected, typing "Ti." does nothing,.

      Obviously, the "sudo gem install json" is needed.

      So, I Opened up the terminal and right there and then ( at the prompt without changing any directories ), I typed "sudo gem install json" and hit enter.

      Terminal asked for a password.

      That's where my buck stopped. My password starts with a ' character. And the terminal just does not accept it as a valid character when entering a password.

      Since sudo password's has a limit of 3 to try out, I felt that this little project started getting near to dangerous territories. At this time, I chose to stop.

      I will change my admin password and then try again ONE MORE TIME and for the last time.

      Any suggestions… And Isn't there another ( a UI way ) of doing this right from within TextMate UI?

      — commented October 1st 2010 by Haluk Karamete
    • Is anyone else having issues with the font not being displayed correctly?
      http://falsebehavinganimals.com/zFtp/textmate.png
      Any help would be greatly appreciated

      — commented November 11th 2010 by Garth Mcrae
  • Fantastic answer…. and thank you for taking the time to answer it that carefully.

    I'm sorry but… I could not test the suggestions… Application Support/Textmate folder is not there!

    Textmate folder under Application Support folder is missing. For some reason 1.5.9 ( which is the latest download from the textmate web site ) does not create that folder. I tried two installs, no luck. I thought this would have been created automatically.

    I'm new to mac and I get confused between the multiple "/library" folders that seem to be repeated in various locations. As a result, I see multiple locations for the "Application Support" folders when I searched for it.

    I always log in as "admin" and there are no other users with admin privilidges on this mac.

    I've got two Applicaiton Support folders..

    one as "macintosh HD/library/Application Support"
    -this one contains 15 sub folders ranging from apple to titanium.

    I also have this;
    "admin/library/Application Support"
    -and this one contains 24 sub folders ranging from "AddressBook" to "Transmission".
    Note that titanium folder is also listed here as well.

    I get confused between the two Application Support folders above, which are both accessible from the "finder" window, one thru places>admin one thru devices>macintosh HD.
    But BOTH ARE MISSING THE TEXTMATE IN THERE! - even though, I just used the textmate and crated a test file with it.

    Lots of questions here…

    Where is the TextMate's Application Support folder?
    Should it be in one of these locations?
    And why is there multiple Application Support folders?
    Which one do I pay attention to ( I always login as "admin" ).
    Isn't there trick to create the proper app support textmate folder by installing a test plugin/bundles using the textmate user interface which will give us a fast track to by pass all these issues?
    Basically, I'm stuck at this level.

    — answered September 30th 2010 by Haluk Karamete
    permalink
    1 Comment
    • I had the same issue.. my Bundles are located inside of the TextMate.App Contents folder…

      — commented September 30th 2010 by Critter
  • The library folder that is on the root of your drive is the one that is for all users and then others are for the users in your example there would be the following folders.

    /Library/Application\ Support (all users can see this one)

    and

    /Users/admin/Library/Application\ Support (the user named admin sees this one AND also the all users folder)

    There is no hard fast rule about folders that you ought to use but generally you want files in your user folders.

    The ~, BTW, is shorthand for your user folder so typing cd ~ is the same as typing cd /Users/[your username] and it's the quickest easiest way to get into your folders.

    I noticed a comment about there being a Bundles folder in the app directory e.g. Textmate.app. You'll want to avoid modifying the contents of that folder because it can and will get replaced when you install new versions of TextMate. The safest place is the Application Support folder for the app.

    I assume since your Bundles folder is missing you can just create one and then continue the installation of the Intellisense bundle. This next command would be your new first step and then continue with the rest.

    mkdir ~/Library/Application\ Support/TextMate/Bundles
    

    Yes there are two Titanium folders in Application Support. I assume the one in the root is there so you can log in as different users and get Titanium running. The one in your users folder is just for you and that is where updates for Titanium's SDK are installed. Found that out the hard way lol.

    Critter - In the bottom bar of your editor there should be an option for selecting the type of file you are editing. There should be an option called 'Titanium Mobile Javascript' Try picking that and see if code completion starts happening automatically.

    Did I miss anything?

    — answered September 30th 2010 by John McKnight
    permalink
    0 Comments
  • John,

    Thanks again.

    I took another path. I downloaded the titanium bundle right from the author's web site ( http://github.com/subtleGradient/JavaScript-Appcelerator-Titanium-Mobile.tmbundle ) and per his instructions re-named the downloaded folder to something.tmbundle and double clicked.

    This took care of the missing Application Support folder and the installing the bundle etc. Now the TextMate do recognize this bundle. But….

    As expected, typing "Ti." does nothing,.

    Obviously, the "sudo gem install json" is needed.

    So, I Opened up the terminal and right there and then ( at the prompt without changing any directories ), I typed "sudo gem install json" and hit enter.

    Terminal asked for a password.

    That's where my buck stopped. My password starts with a ' character. And the terminal just does not accept it as a valid character when entering a password.

    Since sudo password's has a limit of 3 to try out, I felt that this little project started getting near to dangerous territories. At this time, I chose to stop.

    I will change my admin password and then try again ONE MORE TIME and for the last time.
    Any suggestions… And Isn't there another ( a UI way ) of doing this right from within TextMate UI?

    — answered October 1st 2010 by Haluk Karamete
    permalink
    1 Comment
    • Holding down option and esc should bring up intellisense. You should also do this…

      Open a JS file and look in the bottom bar of your editor there should be an option for selecting the type of file you are editing. In that list there should be one called 'Titanium Mobile Javascript' pick that and see if code completion starts happening automatically.

      Of course this depends on the JSON GEM being installed.

      On a separate note, you can usually escape "illegal" characters with a \ so you may be able to enter the ' as \' BTW - that is why the space in the Application Support are shown as Application\ Support in the terminal.

      — commented October 1st 2010 by John McKnight
  • Well, changing admin password was unnecessary. When my terminal asks for a password, it simply does not take any character as input. There is a gray cursor that sits right in front of the word "password:" but no characters are taken at that point. If you hit enter ( which I already did once ), a bad attempt is recorded and get a warning that I can try the admin password only 3 times.

    What could be the reason that this smart program asks for a password and then takes no input (except hitting the enter key and take that as blank password and consider this input as a bad attempt ) ? I'm baffled.

    Here are the steps to generate that problem;

    I open up terminal and at the admin$ prompt, I enter "sudo gem install json"

    In response I get this;

    WARNING: Improper use of sudo command could lead to data loss or the deletion of some important system files. Please double-check your typing when using sudo. Type "man sudo" for more information.

    To proceed, enter your password, or type Ctrl-C to abort.

    Password:

    — answered October 1st 2010 by Haluk Karamete
    permalink
    1 Comment
    • The password prompt in an OSX Terminal is not like other places or programs because it accepts the keys but doesn't show what you are typing and doesn't show * or any other characters. Trust me, it's taking input and you can type your admin password when it asks for it and then press enter.

      The first time you use sudo, you get that warning but it is never shown again. It's mostly a disclaimer to people so they know not to do something disastrous like a recursive delete of all files with full admin privileges. However a command like sudo gem install is pretty safe so I wouldn't worry about it.

      — commented October 1st 2010 by John McKnight
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.