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