How to get CodeIntel working in Sublime Text on OSX

Posted in Uncategorized

SublimeCodeIntel is perhaps the most useful and heavily installed package for Sublime Text but it’s also very difficult to get working. The most common issue people run into is the dreaded endless

Info: processing `PHP’: Please wait…

This can be fixed by navigating to the SublimeCodeIntel package directory and running build.sh. For build.sh to compile we first need to install two things: pcre and XCode Command Line Tools. Annoyingly this is around 1.6GB of files!


Installing XCode Command Line Tools

Head over here and click View in Mac App Store. Hit install and watch your progress in the Purchases tab.

Once installed open it up and go to XCode – Preferences – Downloads – Components and install Command Line Tools.


Installing pcre

This little script is required by the scintilla package of SublimeCodeIntel. First install MacPorts then run:

sudo port install autoconf
sudo port install pcre
sudo cp /opt/local/include/pcre.h /usr/include/

You’re done! Navigate to the SublimeCodeIntel package directory and run sh src/build.sh. If all goes well at the end of compilation you’ll see a done! message. Restart Sublime Text and you’re good to go.

  • Daniel Smedegaard Buus

    I think autoconf is already part of the Xcode CLT, at least on my system I already had it installed, and I haven’t manually added it.

    Also, does this actually make autocomplete work for you? My problem is that PHP “jump to definition” (i.e. Alt+Click or Super+F3) works on a symbol, but I never get autocompletion for that same symbol.

    This behavior remains the same, even after manually building SCI, as you suggest here?

    Cheers 🙂

    • Flynsarmy

      I’ve found that autocmoplete is shitty at best. For example if I have

      	class MyLongClassName
      		function my_long_function_name($arg1, $arg2)
      			return $arg1 . $arg2;
      	$myclass = new MyLongClassName();

      If I now type $myclass->my_ I get autocomplete for the rest of the function name. If I press enter to autocomplete, the tooltip down the bottom says

      Parse error, 1 occurrency of “my_long_function_name”. Line 11, Column 36

      however if I type out the full $myclass->my_long_function_name( quick enough I get

      Tip: my_long_function_name($arg1, $arg2), Parse error, Line 11, Column 37

      Note that this only happens if I type quick enough. If I’m too slow I just get

      Parse error, Line 11, Column 37

      It’s pretty frustrating and I’d really have preferred autocomplete ‘just worked’ and appeared as a tooltip above the actual line I’m typing on rather than in the multipurpose toolbar down the bottom. Using the toolbar down the bottom you don’t get the docblock above functions either. This is where Komodo Edit’s autocomplete kicks the crap out of Sublime code intel.

      I think it probably works all the time it’s just hte PHP interpreter overrides it in the toolbar down the bottom so you don’t get to see codeintel.

  • Stefano Vollono

    Hi! i found this issue on sublimecodeintel 2.0.6 with sublime text 2. I use mavericks. You know how to solve? I can’t find build.sh in package directory.

    • Efro

      Hi, Do you get any solution for build.sh?