diff --git a/fixtures/symbols.php b/fixtures/symbols.php index 26379e4..1103ac3 100644 --- a/fixtures/symbols.php +++ b/fixtures/symbols.php @@ -10,10 +10,9 @@ class TestClass implements TestInterface public static $staticTestProperty; public $testProperty; - public static function staticTestMethod() - { + public static function staticTestMethod() {} - } + public function __construct() {} public function testMethod($testParameter) { diff --git a/src/Protocol/SymbolInformation.php b/src/Protocol/SymbolInformation.php index 461b430..af5a946 100644 --- a/src/Protocol/SymbolInformation.php +++ b/src/Protocol/SymbolInformation.php @@ -63,7 +63,11 @@ class SymbolInformation throw new Exception("Not a declaration node: $class"); } $symbol = new self; - $symbol->kind = $nodeSymbolKindMap[$class]; + if ($node instanceof Node\Stmt\ClassMethod && $node->name === '__construct') { + $symbol->kind = SymbolKind::CONSTRUCTOR; + } else { + $symbol->kind = $nodeSymbolKindMap[$class]; + } $symbol->name = (string)$node->name; $symbol->location = Location::fromNode($node); if ($fqn !== null) {