Skip to content

Commit 3c11cde

Browse files
authored
Include packages-dev (#282)
1 parent 5100d89 commit 3c11cde

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Server/TextDocument.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ public function xdefinition(TextDocumentIdentifier $textDocument, Position $posi
412412
if (preg_match('/\/vendor\/([^\/]+\/[^\/]+)\//', $def->symbolInformation->location->uri, $matches) && $this->composerLock !== null) {
413413
// Definition is inside a dependency
414414
$packageName = $matches[1];
415-
foreach ($this->composerLock->packages as $package) {
415+
foreach (array_merge($this->composerLock->packages, $this->composerLock->{'packages-dev'}) as $package) {
416416
if ($package->name === $packageName) {
417417
$symbol->package = $package;
418418
break;

src/Server/Workspace.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function xreferences($query, array $files = null): Promise
124124
// Find out package name
125125
preg_match('/\/vendor\/([^\/]+\/[^\/]+)\//', $def->symbolInformation->location->uri, $matches);
126126
$packageName = $matches[1];
127-
foreach ($this->composerLock->packages as $package) {
127+
foreach (array_merge($this->composerLock->packages, $this->composerLock->{'packages-dev'}) as $package) {
128128
if ($package->name === $packageName) {
129129
$symbol->package = $package;
130130
break;
@@ -165,7 +165,7 @@ public function xdependencies(): array
165165
return [];
166166
}
167167
$dependencyReferences = [];
168-
foreach ($this->composerLock->packages as $package) {
168+
foreach (array_merge($this->composerLock->packages, $this->composerLock->{'packages-dev'}) as $package) {
169169
$dependencyReferences[] = new DependencyReference($package);
170170
}
171171
return $dependencyReferences;

0 commit comments

Comments
 (0)