From 7c4376801875659f72412907b5141b8f2a20ab55 Mon Sep 17 00:00:00 2001 From: Florian Schunk Date: Tue, 12 Nov 2019 20:42:58 +0100 Subject: [PATCH] Bugfix --- src/Server/TextDocument.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Server/TextDocument.php b/src/Server/TextDocument.php index a18d4a3..dfc09db 100644 --- a/src/Server/TextDocument.php +++ b/src/Server/TextDocument.php @@ -236,6 +236,10 @@ class TextDocument return []; } } + $nameParts = preg_split('/[\>\\\:]/', $fqn); + $name = end($nameParts); + $nameParts = explode('(', $name); + $name = $nameParts[0]; $refDocumentPromises = []; foreach ($this->index->getReferenceUris($fqn) as $uri) { $refDocumentPromises[] = $this->documentLoader->getOrLoad($uri); @@ -275,7 +279,7 @@ class TextDocument }elseif ($ref instanceof Node\ClassMembersNode) { foreach ($ref->classMemberDeclarations as $declaration) { if ($declaration instanceof Node\MethodDeclaration) { - if ($declaration->getName() === $node->name->getText($node->getFileContents())) { + if ($declaration->getName() === $name ) { $location = LocationFactory::fromToken($declaration, $declaration->name); $locations[] = $location; }