code_martial
code_martial

Reputation: 1245

Etags fails to understand access modifiers for PHP

I was trying to generate etags for PHP class files and realised that it doesn't comprehend access modifiers (private/protected/public) and 'static' keyword in front of function declarations! For example, if the file contents are:

<?php
class Foo {
  public static function doBar() {}
  protected function isBaz() {}
}

Running etags -l php on the file will only result in class Foo being recognised. If I drop the keywords in front of function, it recognises the function names correctly.

Does anyone know of a solution for getting etags to identify PHP tags correctly?

Upvotes: 1

Views: 234

Answers (1)

plhn
plhn

Reputation: 5263

use exuberant ctags with '-e' option.

find . -name \*php | xargs ctags -e -f TAGS --language-force=php 

Upvotes: 2

Related Questions