1
0
Fork 0

Include packages-dev (#282)

pull/281/head
Felix Becker 2017-02-06 16:35:16 +01:00 committed by GitHub
parent 5100d89617
commit 3c11cde9fb
2 changed files with 3 additions and 3 deletions

View File

@ -412,7 +412,7 @@ class TextDocument
if (preg_match('/\/vendor\/([^\/]+\/[^\/]+)\//', $def->symbolInformation->location->uri, $matches) && $this->composerLock !== null) { if (preg_match('/\/vendor\/([^\/]+\/[^\/]+)\//', $def->symbolInformation->location->uri, $matches) && $this->composerLock !== null) {
// Definition is inside a dependency // Definition is inside a dependency
$packageName = $matches[1]; $packageName = $matches[1];
foreach ($this->composerLock->packages as $package) { foreach (array_merge($this->composerLock->packages, $this->composerLock->{'packages-dev'}) as $package) {
if ($package->name === $packageName) { if ($package->name === $packageName) {
$symbol->package = $package; $symbol->package = $package;
break; break;

View File

@ -124,7 +124,7 @@ class Workspace
// Find out package name // Find out package name
preg_match('/\/vendor\/([^\/]+\/[^\/]+)\//', $def->symbolInformation->location->uri, $matches); preg_match('/\/vendor\/([^\/]+\/[^\/]+)\//', $def->symbolInformation->location->uri, $matches);
$packageName = $matches[1]; $packageName = $matches[1];
foreach ($this->composerLock->packages as $package) { foreach (array_merge($this->composerLock->packages, $this->composerLock->{'packages-dev'}) as $package) {
if ($package->name === $packageName) { if ($package->name === $packageName) {
$symbol->package = $package; $symbol->package = $package;
break; break;
@ -165,7 +165,7 @@ class Workspace
return []; return [];
} }
$dependencyReferences = []; $dependencyReferences = [];
foreach ($this->composerLock->packages as $package) { foreach (array_merge($this->composerLock->packages, $this->composerLock->{'packages-dev'}) as $package) {
$dependencyReferences[] = new DependencyReference($package); $dependencyReferences[] = new DependencyReference($package);
} }
return $dependencyReferences; return $dependencyReferences;