Reputation: 11
I just recently swapped out Espresso with Sublime Text 2 because of the large amount of available packages. I use the software mainly for web developing and installed quite a few packages.
All Autocomplete, AndyPHP, PHP Completions KIT and SublimeCodeIntel for completions.
The reason for installing all these, and not just SublimeCodeIntel is because SublimeCodeIntel did not work as I expected.
None of these(together or not) will complete classes, functions or variables names defined in project files.
Just an example to illustrate the problem.
If I define a simple function in one of my files,
function sayOutLoud($x) { echo $x; }
and when I start typing sayOu... I would like Sublime to suggest the function name, and if I choose sayOutLoud I want to know what arguments the function takes(of course I know, but you understand). Should not anyone of these packages do this?
update: after a reboot, strangely enough some completion started working. But it doesn`t give me the argument list.
If I disable SublimeCodeIntel(the package I was told to be one of the best), nothing changes, so in other words, it does not add anything when its active.
Upvotes: 0
Views: 384
Reputation: 33
i would suggest you to do this by creating you own snippet if you're using this function a frequently, here is a simple snippet that you can use (you don't need any sublime plugin ) 1) go to tools > new snippet the default content of the page that you will get is something like this :
<snippet>
<content><![CDATA[
Hello, ${1:this} is a ${2:snippet}.
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>
2) write your function definition in the third line (remove Hello, ${1:this} is a ${2:snippet}.)
in our case the function definition will be like this :
function sayOutLoud(${1:\$x}) { ${2:echo} ${3:\$x};${4:} }
3) uncomment the sixth line so it would work if you type the sayOutLoud (replace the sixth line with the following) an you press tab:
<tabTrigger>sayOutLoud</tabTrigger>
4) save the file under the name sayOutLoud.sublime-snippet
NOW If you open any php file and you type sayOutLoud you will see an auto completion and if you press tab you will see the function added to you file and that's IT.
Upvotes: 2