Sublime Forum

Autocompletion: confused about how to get it working

#1

Is there any standard, recommended way to get code autocompletion working?

I have a fresh installation of 2.02 and a PHP project with a simple my.sublime-project file (one path defined). All Sublime seems to know about are native PHP functions. It doesn’t get it, e.g., when $foo is an instance of My\Namespace\Foo and offer to autocomplete instance methods etc., even with ample doc comments to provide hints.

Aside: I am a refugee from Netbeans. I am grateful to the authors but cannot take the slowness and the freezing-up any more. But one of the many good things about Netbeans is that code completion (nearly always) “just works,” including displaying the doc comments from the function or method being presented. I want that.

Neither sublime-text-unofficial-document … tions.html is of much help.

From searching I see that there is github.com/alienhard/SublimeAllAutocomplete but there also seem to be other solutions available. Experienced users, what should I do?

Thanks.

UPDATE: I have installed github.com/SublimeCodeIntel/SublimeCodeIntel but it’s not getting it done, either. It works on it for ~20 seconds and then nothing happens except a warning from ST telling me the plugin is taking too long.

0 Likes

#2

Basically, by default Sublime Text does not do type-resolving and smart completions. It only sports a default set of completions that are defined statically (the built-in functions) and symbols or variables used in the current buffer. Everything else needs to be provided by a plugin.

SublimeCodeIntel is one of these plugins, that do lexical analysis of your code to provide smart auto completions. packagecontrol.io/packages/PHPIntel is another one.
I can’t provide support for either though since I don’t use any.

0 Likes

#3

I hereby retract my previous comment about CodeIntel not getting it done. It does take time to scan a project (mine is substantial, I guess) and it does not display the doc comments – but it DOES WORK and I am deeply grateful to the author(s).

0 Likes