Search code examples
phpvimnamespacesexuberant-ctags

How do I configure ctags to index PHP namespaces and their aliases?


when using PHP namespaces the code I work on uses a large number of namespace aliases, e.g.

<?php
namespace foo;

use bar\baz\qux as bazQux;

...

$a = new bazQux();

Is it possible to configure Exuberant Ctags to index the use of these namespace aliases so that I can jump from a line where the alias is used (the instantiation above) straight to the real class? If that's not possible, what's the best compromise that can be achieved?

I've seen somewhere a not-yet-integrated patch for ctags to use a PHP tokenizer for PHP support instead of the current regex-based implementation; I'd like to continue to use a stock ctags if possible though, rather than having to patch and compile a version myself.


Solution

  • This is the official changelog: http://ctags.sourceforge.net/news.html

    They don't seem to merged yet this patch:

    http://sourceforge.net/mailarchive/message.php?msg_id=30749245

    So I don't think you can find a prebuilt package with php namespace support.