shawncplus/phpcomplete.vim — pull request #50 by tox2ik (2014-09-27 16:25:34+00:00)
Title: fix: erratic initialization of tags

Short version
-------------

phpcomplete#GetCurrentNameSpace(file_lines) returns a Dictionary
of duplicate values with different keys (one for each import)
to the main phpcomplete#CompletePHP(findstart, base) function.

The author of the original code forgot to unsed the
'no_namespace_candidate' tag for each (tag in imports) iterations.

Details
-------

The values from 'no_namespace_candidate' were assignet do
all keys in the 'imports' dictionary.

This is a huge bug because if a .php file specified more
than one 'use dependency', they would all point to the file
and methods of the -last- use dependency.

I have reproduced the error in the tarball below. Try switching
the order of the two use statements and see what happens.

This is on a non-patched ctags.

list of software:

$ exuberant-ctags --version
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
Compiled: Nov 15 2011, 20:02:35
Addresses: , http://ctags.sourceforge.net
Optional compiled features: +wildcards, +regex

$ gvim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 27 2014 14:49:31)
Included patches: 1-417
Modified by Gentoo-7.4.417

Tarball (demonstrates bug)
--------------------------
$ tar -cv -f- project-complete/ | gzip | base64
project-complete/
project-complete/Zumba.php
project-complete/autoload/
project-complete/autoload/autoload.php
project-complete/autoload/autoload.sh
project-complete/php.ctags
project-complete/make.php.ctags
project-complete/Do.php
project-complete/Group/
project-complete/Group/Task.php
H4sIABzlJlQAA+1a63PaOBDPV/RXbHPMQdIaYR7hrjnSZtr0MZM2HZr2Q0tKFFuAG2O7kpykj/zv
J8mYNyUPQueu+k0mCEm7K3u1q91FEQs/U0dYTtiLfCooXls+ihK1alV9lmrV4uhnijW7VLHt6pZd
KZfXinalulVcg+odrGUKMReEAax9JizkPjmbN2/R+H8U0aT+P8S9E1KIutHyZCgFb1Uqc/VfqlT7
+q9UirYt9b9VrthrUFzeEubjN9f/P4+kqlFAepRHxKHwLAy3EXJ8wjnorQDfUSaKT3zPgWwv5p6z
Pfzuhw4RXhgMu9px4Kge4F1ySvPZk9D9GhEmNuD75fQklwQOzc8e4yKMk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