Sublime Forum

Php function name completion

#1

I have several files in my PHP project, if I define a function in one file - ST2 autocompletes the function name in that file. However, if I try in a different file, ST2 does NOT autocomplete. I’m brand new to ST2, so I assume I haven’t set something up correctly. What did I do wrong?

Additionally, any suggested guides out there on getting started with ST2 for PHP work?

0 Likes

#2

Hi there,

ST doesn’t really support project autocomplete, in ST3 you have goto_definition that works like a charm, but it does not autocomplete because of several reasons (you may find them in the forums) but basically it needs to create an index for each file and language, and to support all languages would be very hard IMHO. (also wouldn’t be fair to other languages if only a few a supported)

you could try using Sublime CodeIntel from Kronuz (https://github.com/Kronuz/SublimeCodeIntel)
in my experience, it worked well in mac and windows, but in linux it usually freezes the index building, specially for PHP

Now, for setting up a PHP development in ST, well that depends on each user, as the way one develops can be very different for everyone… I usually don’t use autocomplete, in ST I just go and open the file I want since is very fast, and in ST3 I can open several files as well with ctrl+P
I don’t remember right now where to have some examples of ST setup for developing… but you may find something useful in Nettuts

Hope this help you

0 Likes