Fixes
parent
372e55725e
commit
ee5b66abc6
|
@ -396,7 +396,8 @@ class TextDocument
|
|||
}
|
||||
if (
|
||||
$def === null
|
||||
|| ($def->symbolInformation !== null && Uri\parse($def->symbolInformation->location->uri)['scheme'] === 'phpstubs')
|
||||
|| $def->symbolInformation === null
|
||||
|| Uri\parse($def->symbolInformation->location->uri)['scheme'] === 'phpstubs'
|
||||
) {
|
||||
return [];
|
||||
}
|
||||
|
@ -406,8 +407,8 @@ class TextDocument
|
|||
if (!$packageName && $this->composerJson !== null) {
|
||||
$packageName = $this->composerJson->name;
|
||||
}
|
||||
$symbol = new SymbolDescriptor($def->fqn, new PackageDescriptor($packageName));
|
||||
return [new SymbolLocationInformation($symbol, $symbol->location)];
|
||||
$descriptor = new SymbolDescriptor($def->fqn, new PackageDescriptor($packageName));
|
||||
return [new SymbolLocationInformation($descriptor, $def->symbolInformation->location)];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,8 @@ use LanguageServer\Protocol\{
|
|||
PackageDescriptor,
|
||||
ReferenceInformation,
|
||||
DependencyReference,
|
||||
Location
|
||||
Location,
|
||||
MessageType
|
||||
};
|
||||
use Sabre\Event\Promise;
|
||||
use function Sabre\Event\coroutine;
|
||||
|
@ -148,7 +149,10 @@ class Workspace
|
|||
foreach ($refs as $uri => $fqns) {
|
||||
foreach ($fqns as $fqn) {
|
||||
$def = $this->dependenciesIndex->getDefinition($fqn);
|
||||
$symbol->fqsen = $fqn;
|
||||
if ($def === null) {
|
||||
$this->client->window->logMessage(MessageType::WARNING, "Reference $fqn not found in index");
|
||||
continue;
|
||||
}
|
||||
// Find out package name
|
||||
$packageName = getPackageName($def->symbolInformation->location->uri, $this->composerJson);
|
||||
$symbol = new SymbolDescriptor($fqn, new PackageDescriptor($packageName));
|
||||
|
|
Loading…
Reference in New Issue