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() public function __construct()
{ {
if (PHP_OS === 'WINNT') { if (strtoupper(substr(php_uname('s'), 0, 3)) === 'WIN') {
$this->cacheDir = getenv('LOCALAPPDATA') . '\\PHP Language Server\\'; $this->cacheDir = getenv('LOCALAPPDATA') . '\\PHP Language Server\\';
} else if (getenv('XDG_CACHE_HOME')) { } else if (getenv('XDG_CACHE_HOME')) {
$this->cacheDir = getenv('XDG_CACHE_HOME') . '/phpls/'; $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) { 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

@ -125,7 +125,7 @@ class Workspace
} }
// Find out package name // Find out package name
$packageName = getPackageName($this->composerJson, $def->symbolInformation->location->uri); $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) { if ($package->name === $packageName) {
$symbol->package = $package; $symbol->package = $package;
break; break;
@ -166,7 +166,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;