Merge branch 'master' into allow-custom-vendor-dir
commit
4cf3fefd09
|
@ -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/';
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue