Merge 88de6556a3
into 08cf1a3fd7
commit
819ac0173f
|
@ -44,7 +44,7 @@ class ComposerScripts
|
||||||
}
|
}
|
||||||
|
|
||||||
$uris = yield $finder->find("$stubsLocation/**/*.php");
|
$uris = yield $finder->find("$stubsLocation/**/*.php");
|
||||||
|
$uris = [];
|
||||||
foreach ($uris as $uri) {
|
foreach ($uris as $uri) {
|
||||||
echo "Parsing $uri\n";
|
echo "Parsing $uri\n";
|
||||||
$content = yield $contentRetriever->retrieve($uri);
|
$content = yield $contentRetriever->retrieve($uri);
|
||||||
|
|
|
@ -237,7 +237,7 @@ class LanguageServer extends AdvancedJsonRpc\Dispatcher
|
||||||
$this->composerLock,
|
$this->composerLock,
|
||||||
$this->composerJson
|
$this->composerJson
|
||||||
);
|
);
|
||||||
$indexer->index()->otherwise('\\LanguageServer\\crash');
|
yield $indexer->index()->otherwise('\\LanguageServer\\crash');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ class PhpDocumentLoader
|
||||||
*
|
*
|
||||||
* @var PhpDocument
|
* @var PhpDocument
|
||||||
*/
|
*/
|
||||||
private $documents = [];
|
public $documents = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var ContentRetriever
|
* @var ContentRetriever
|
||||||
|
|
|
@ -265,7 +265,15 @@ class TextDocument
|
||||||
public function definition(TextDocumentIdentifier $textDocument, Position $position): Promise
|
public function definition(TextDocumentIdentifier $textDocument, Position $position): Promise
|
||||||
{
|
{
|
||||||
return coroutine(function () use ($textDocument, $position) {
|
return coroutine(function () use ($textDocument, $position) {
|
||||||
$document = yield $this->documentLoader->getOrLoad($textDocument->uri);
|
$documentLoader = $this->documentLoader;//->getOrLoad($textDocument->uri);
|
||||||
|
$document = null;
|
||||||
|
if (isset($documentLoader->documents[$textDocument->uri])) {
|
||||||
|
$document = $documentLoader->documents[$textDocument->uri];
|
||||||
|
} else {
|
||||||
|
$document = yield $documentLoader->load($textDocument->uri);
|
||||||
|
$documentLoader->documents[$textDocument->uri] = $document;
|
||||||
|
}
|
||||||
|
|
||||||
$node = $document->getNodeAtPosition($position);
|
$node = $document->getNodeAtPosition($position);
|
||||||
if ($node === null) {
|
if ($node === null) {
|
||||||
return [];
|
return [];
|
||||||
|
|
Loading…
Reference in New Issue