index = $index; $this->client = $client; } /** * The workspace symbol request is sent from the client to the server to list project-wide symbols matching the query string. * * @param string $query * @return SymbolInformation[] */ public function symbol(string $query): array { $symbols = []; foreach ($this->index->getDefinitions() as $fqn => $definition) { if ($query === '' || stripos($fqn, $query) !== false) { $symbols[] = $definition->symbolInformation; } } return $symbols; } }