I'm using Visual Studio Code on Windows 10. The file names are identical as well, same casing. PHP Tools version: v1.28.12200, Community edition.
I noticed that after restarting VSCode, everything works fine until I open the Source Control view on the left, and push my local changes to Git. Then the files I modified appear twice when using the "Go to definition" feature.
Say, I modified and pushed
Y.php, I Ctrl-click a method defined in
X.php appears twice. If I Ctrl-click a method defined in
Z.php, it still works fine. It might be worth noting that I'm using namespaces and classes, and the classloader implementation that can be found at https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader-examples.md (see the "Class Example" section).
I tried to reproduce the problem with a plain function definition instead of a class method, and the problem does not seem to occur (it was just a quick test though). I'm having a folder and file name structure that corresponds to the namespace and class name, i.e.
Namespace\X.php contains class
Namespace\Y.php contains class
\Namespace\Y etc., and the code of
Y references e.g.
$instanceOfX->methodName(). When the problem occurs, the reference count above the definition also counts references twice.
EDIT: if I modify the plain function and push it again, then clicking "Go to definition" lists the function twice as well, i.e. the problem is not related to classes. Sorry for the confusion.
Let me know if you need more info.