Ctags breaks PHP Intellisensing
Posted: Wed Sep 29, 2004 7:42 am
Unfortunately it appears the Exuberant CTAGS support PHP is not as good as it could be 
Consider the following snippet of PHP code:
If this code is saved to a test.php file and parsed by ctags, the following tags are produced:
If the same code is then saved to a test.cpp file, ctags will now produce the following tags:
It appears the c/c++ tagger is doing a better job of tagging the PHP code than the PHP tagger itself 
For example, the c/c++ tagger correctly identifies the MyMethod method belonging to the MyClass class, while the PHP tagger incorrectly sees the method as a function, no way related to the class.
Since Zeus uses the ctags output to populate the class browser and uses the class browser to manage the code completion and intellisensing, in the case described the PHP class browser information is wrong and as such the intellisensing will not work as well as it should
Jussi

Consider the following snippet of PHP code:
Code: Select all
class MyClass
{
// the constructor
function MyClass()
{
}
// the method
function MyMethod($gear)
{
}
};
Code: Select all
MyClass test.php /^class MyClass$/; " kind:class line:2 language:PHP
MyClass test.php /^function MyClass()$/; " kind:function line:5 language:PHP
MyMethod test.php /^function MyMethod($gear)$/;" kind:function line:10 language:PHP
Code: Select all
MyClass test.cpp /^class MyClass$/; " kind:class line:1 language:C++ file:
MyClass test.cpp /^function MyClass()$/; " kind:function line:4 language:C++ class:MyClass file: access:private signature:()
MyMethod test.cpp /^function MyMethod($gear)$/;" kind:function line:9 language:C++ class:MyClass file: access:private signature:($gear)

For example, the c/c++ tagger correctly identifies the MyMethod method belonging to the MyClass class, while the PHP tagger incorrectly sees the method as a function, no way related to the class.
Since Zeus uses the ctags output to populate the class browser and uses the class browser to manage the code completion and intellisensing, in the case described the PHP class browser information is wrong and as such the intellisensing will not work as well as it should

Jussi