Skip to content
This repository was archived by the owner on Mar 6, 2022. It is now read-only.

Commit 817179b

Browse files
committed
Fix hover on namespaced function
1 parent 3265e50 commit 817179b

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/LanguageServerHover/Handler/HoverHandler.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ private function renderMember(SymbolContext $symbolContext): string
175175

176176
private function renderFunction(SymbolContext $symbolContext): string
177177
{
178-
$name = $symbolContext->symbol()->name();
178+
$name = $symbolContext->name();
179179
$function = $this->reflector->reflectFunction($name);
180180

181181
return $this->renderer->render(new HoverInformation($name, $function->docblock()->formatted(), $function));

tests/LanguageServerCompletion/Unit/Handler/HoverHandlerTest.php

+10
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,15 @@ private function f<>oo():string {}
8484
'<?php cl<>ass A { } }',
8585
'A'
8686
];
87+
88+
yield 'function' => [
89+
'<?php function foo() {} f<>oo();',
90+
'A'
91+
];
92+
93+
yield 'namespaced function' => [
94+
'<?php namespace Barf {function foo() {}} Barf\f<>oo();',
95+
'A'
96+
];
8797
}
8898
}

0 commit comments

Comments
 (0)