From c54b817ba6f253f689257588aae2e918886abbfe Mon Sep 17 00:00:00 2001 From: Florian Schunk Date: Tue, 5 Nov 2019 20:36:10 +0100 Subject: [PATCH] allow rename of methods --- src/Server/TextDocument.php | 9 +++++++++ 1 file changed, 9 insertions(+) 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; + } + } + } } } }