diff --git a/src/Cache/FileSystemCache.php b/src/Cache/FileSystemCache.php index 8a507f7..5e9f523 100644 --- a/src/Cache/FileSystemCache.php +++ b/src/Cache/FileSystemCache.php @@ -18,7 +18,7 @@ class FileSystemCache implements Cache public function __construct() { - if (PHP_OS === 'WINNT') { + if (strtoupper(substr(php_uname('s'), 0, 3)) === 'WIN') { $this->cacheDir = getenv('LOCALAPPDATA') . '\\PHP Language Server\\'; } else if (getenv('XDG_CACHE_HOME')) { $this->cacheDir = getenv('XDG_CACHE_HOME') . '/phpls/'; diff --git a/src/Server/TextDocument.php b/src/Server/TextDocument.php index b087807..a23358f 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 55821ac..2699de4 100644 --- a/src/Server/Workspace.php +++ b/src/Server/Workspace.php @@ -125,7 +125,7 @@ class Workspace } // Find out package name $packageName = getPackageName($this->composerJson, $def->symbolInformation->location->uri); - 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; @@ -166,7 +166,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;