project = $project; $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 { if ($query === '') { return array_values($this->project->getSymbols()); } $symbols = []; foreach ($this->project->getSymbols() as $fqn => $symbol) { if (stripos($fqn, $query) !== false) { $symbols[] = $symbol; } } return $symbols; } }