1
0
Fork 0

Merge branch 'master' into allow-custom-vendor-dir

pull/281/head
Trevor Bortins 2017-02-07 09:15:56 -08:00 committed by GitHub
commit 4cf3fefd09
3 changed files with 4 additions and 4 deletions

View File

@ -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/';

View File

@ -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;

View File

@ -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;