diff --git a/src/Server/TextDocument.php b/src/Server/TextDocument.php index 532d642..624bc67 100644 --- a/src/Server/TextDocument.php +++ b/src/Server/TextDocument.php @@ -412,7 +412,7 @@ class TextDocument if (preg_match('/\/vendor\/([^\/]+\/[^\/]+)\//', $def->symbolInformation->location->uri, $matches) && $this->composerLock !== null) { // Definition is inside a dependency $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) { $symbol->package = $package; break; diff --git a/src/Server/Workspace.php b/src/Server/Workspace.php index 5aae7cf..5c0e9fa 100644 --- a/src/Server/Workspace.php +++ b/src/Server/Workspace.php @@ -124,7 +124,7 @@ class Workspace // Find out package name preg_match('/\/vendor\/([^\/]+\/[^\/]+)\//', $def->symbolInformation->location->uri, $matches); $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) { $symbol->package = $package; break; @@ -165,7 +165,7 @@ class Workspace return []; } $dependencyReferences = []; - foreach ($this->composerLock->packages as $package) { + foreach (array_merge($this->composerLock->packages, $this->composerLock->{'packages-dev'}) as $package) { $dependencyReferences[] = new DependencyReference($package); } return $dependencyReferences;