shawncplus / phpcomplete.vim

Improved PHP omnicompletion
http://www.vim.org/scripts/script.php?script_id=3171
595 stars 110 forks source link

Jump to tag when you have many tags with same name. #122

Closed borissov closed 5 years ago

borissov commented 5 years ago

Hello, I work on old legacy code and I have a lot classes with different names but they have the same method name members. When I try to jump to tag, VIM opens not right file :(. Tags are generated with Gutentags.

class A{
  public static function getData()
  {
  }
}

class B{
  public static function getData()
  {
  }
}

Any idea how can I fix this. Thanks in advance.

complex857 commented 5 years ago

There are two things that could be happening here:

  1. The tag database doesn't have namespaces and classes. I'm not intimately familiar with gutentag, but from what I understood it uses the locally installed ctags binary on your system. This most likely means you won't have any access to newer features (like namespace or class detection on methods). Could you show me one of these tag lines for a getData function shown above?

  2. It could be that the place where you are trying to jump from doesn't have enough information to figure out what class it should be (with static methods this should be less tricky, but still). Could you show me what the line where you are jumping from looks like?

borissov commented 5 years ago

Fix it. It's wrong generated tags files. Thanks a lot.