diff --git a/src/Server/TextDocument.php b/src/Server/TextDocument.php index e5ddf9a..988c3d2 100644 --- a/src/Server/TextDocument.php +++ b/src/Server/TextDocument.php @@ -265,6 +265,15 @@ class TextDocument $location = LocationFactory::fromNode($ref); $location->range->start->character++; $locations[] = $location; + }elseif ($ref instanceof Node\ClassMembersNode) { + foreach ($ref->classMemberDeclarations as $declaration) { + if ($declaration instanceof Node\MethodDeclaration) { + if ($declaration->getName() === $node->getName()) { + $location = LocationFactory::fromToken($declaration, $declaration->name); + $locations[] = $location; + } + } + } } } }