phpactor / vscode-phpactor

Phpactor VS Code Extension
MIT License
124 stars 8 forks source link

Request textDocument/definition failed. IteratorAggregate #117

Open Yarad opened 7 months ago

Yarad commented 7 months ago

Hey guys, really appreciate your work. Could you take a look at the problem I'm facing?

Came across this when opening classes that implement IteratorAggregate. Like this:

<?php

namespace Pagination;

use Closure;
use IteratorAggregate;
use Traversable;

/**
 * @template T
 * @implements IteratorAggregate<T>
 */
class CursorPaginator implements IteratorAggregate
{
...

Exception thrown:

[Error - 10:46:04 AM] Request textDocument/definition failed.
  Message: Exception [Phpactor\TextDocument\Exception\TextDocumentNotFound] Text document "file:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/lib/WorseReflection/Core/SourceCodeLocator/InternalStubs/Iterator.php" not found at phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/lib/TextDocument/Exception/TextDocumentNotFound.php#12
  Code: -32603 
#0 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/lib/TextDocument/TextDocumentLocator/ChainDocumentLocator.php(29): Phpactor\TextDocument\Exception\TextDocumentNotFound::fromUri(Object(Phpactor\TextDocument\TextDocumentUri))
#1 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/lib/Extension/LanguageServerBridge/Converter/LocationConverter.php(39): Phpactor\TextDocument\TextDocumentLocator\ChainDocumentLocator->get(Object(Phpactor\TextDocument\TextDocumentUri))
#2 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/lib/Extension/LanguageServerReferenceFinder/Handler/GotoDefinitionHandler.php(62): Phpactor\Extension\LanguageServerBridge\Converter\LocationConverter->toLspLocation(Object(Phpactor\TextDocument\Location))
#3 [internal function]: Phpactor\Extension\LanguageServerReferenceFinder\Handler\GotoDefinitionHandler->Phpactor\Extension\LanguageServerReferenceFinder\Handler\{closure}()
#4 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/amphp/amp/lib/Coroutine.php(67): Generator->current()
#5 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/amphp/amp/lib/functions.php(96): Amp\Coroutine->__construct(Object(Generator))
#6 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/lib/Extension/LanguageServerReferenceFinder/Handler/GotoDefinitionHandler.php(81): Amp\call(Object(Closure))
#7 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/phpactor/language-server/lib/Core/Handler/HandlerMethodRunner.php(86): Phpactor\Extension\LanguageServerReferenceFinder\Handler\GotoDefinitionHandler->definition(Object(Phpactor\LanguageServerProtocol\DefinitionParams), Object(Amp\CancellationToken@anonymous))
#8 [internal function]: Phpactor\LanguageServer\Core\Handler\HandlerMethodRunner->Phpactor\LanguageServer\Core\Handler\{closure}()
#9 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/amphp/amp/lib/Coroutine.php(67): Generator->current()
#10 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/amphp/amp/lib/functions.php(96): Amp\Coroutine->__construct(Object(Generator))
#11 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/phpactor/language-server/lib/Core/Handler/HandlerMethodRunner.php(102): Amp\call(Object(Closure))
#12 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/phpactor/language-server/lib/Middleware/HandlerMiddleware.php(38): Phpactor\LanguageServer\Core\Handler\HandlerMethodRunner->dispatch(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage))
#13 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/phpactor/language-server/lib/Core/Middleware/RequestHandler.php(37): Phpactor\LanguageServer\Middleware\HandlerMiddleware->process(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage), Object(Phpactor\LanguageServer\Core\Middleware\RequestHandler))
#14 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/phpactor/language-server/lib/Middleware/ResponseHandlingMiddleware.php(35): Phpactor\LanguageServer\Core\Middleware\RequestHandler->handle(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage))
#15 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/phpactor/language-server/lib/Core/Middleware/RequestHandler.php(37): Phpactor\LanguageServer\Middleware\ResponseHandlingMiddleware->process(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage), Object(Phpactor\LanguageServer\Core\Middleware\RequestHandler))
#16 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/phpactor/language-server/lib/Middleware/MethodAliasMiddleware.php(37): Phpactor\LanguageServer\Core\Middleware\RequestHandler->handle(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage))
#17 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/phpactor/language-server/lib/Core/Middleware/RequestHandler.php(37): Phpactor\LanguageServer\Middleware\MethodAliasMiddleware->process(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage), Object(Phpactor\LanguageServer\Core\Middleware\RequestHandler))
#18 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/phpactor/language-server/lib/Middleware/CancellationMiddleware.php(49): Phpactor\LanguageServer\Core\Middleware\RequestHandler->handle(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage))
#19 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/phpactor/language-server/lib/Core/Middleware/RequestHandler.php(37): Phpactor\LanguageServer\Middleware\CancellationMiddleware->process(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage), Object(Phpactor\LanguageServer\Core\Middleware\RequestHandler))
#20 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/phpactor/language-server/lib/Middleware/ShutdownMiddleware.php(68): Phpactor\LanguageServer\Core\Middleware\RequestHandler->handle(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage))
#21 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/phpactor/language-server/lib/Core/Middleware/RequestHandler.php(37): Phpactor\LanguageServer\Middleware\ShutdownMiddleware->process(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage), Object(Phpactor\LanguageServer\Core\Middleware\RequestHandler))
#22 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/phpactor/language-server/lib/Middleware/InitializeMiddleware.php(56): Phpactor\LanguageServer\Core\Middleware\RequestHandler->handle(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage))
#23 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/phpactor/language-server/lib/Core/Middleware/RequestHandler.php(37): Phpactor\LanguageServer\Middleware\InitializeMiddleware->process(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage), Object(Phpactor\LanguageServer\Core\Middleware\RequestHandler))
#24 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/phpactor/language-server/lib/Middleware/ErrorHandlingMiddleware.php(34): Phpactor\LanguageServer\Core\Middleware\RequestHandler->handle(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage))
#25 [internal function]: Phpactor\LanguageServer\Middleware\ErrorHandlingMiddleware->Phpactor\LanguageServer\Middleware\{closure}()
#26 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/amphp/amp/lib/Coroutine.php(67): Generator->current()
#27 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/amphp/amp/lib/functions.php(96): Amp\Coroutine->__construct(Object(Generator))
#28 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/phpactor/language-server/lib/Middleware/ErrorHandlingMiddleware.php(73): Amp\call(Object(Closure))
#29 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/phpactor/language-server/lib/Core/Middleware/RequestHandler.php(37): Phpactor\LanguageServer\Middleware\ErrorHandlingMiddleware->process(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage), Object(Phpactor\LanguageServer\Core\Middleware\RequestHandler))
#30 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/phpactor/language-server/lib/Core/Dispatcher/Dispatcher/MiddlewareDispatcher.php(29): Phpactor\LanguageServer\Core\Middleware\RequestHandler->handle(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage))
#31 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/phpactor/language-server/lib/Core/Server/LanguageServer.php(223): Phpactor\LanguageServer\Core\Dispatcher\Dispatcher\MiddlewareDispatcher->dispatch(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage))
#32 [internal function]: Phpactor\LanguageServer\Core\Server\LanguageServer->Phpactor\LanguageServer\Core\Server\{closure}()
#33 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/amphp/amp/lib/Coroutine.php(67): Generator->current()
#34 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/amphp/amp/lib/functions.php(96): Amp\Coroutine->__construct(Object(Generator))
#35 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/amphp/amp/lib/functions.php(121): Amp\call(Object(Closure))
#36 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/phpactor/language-server/lib/Core/Server/LanguageServer.php(240): Amp\asyncCall(Object(Closure))
#37 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/phpactor/language-server/lib/Core/Server/LanguageServer.php(214): Phpactor\LanguageServer\Core\Server\LanguageServer->dispatchRequest(Object(Phpactor\LanguageServer\Core\Server\Transmitter\ConnectionMessageTransmitter), Object(Phpactor\LanguageServer\Core\Dispatcher\Dispatcher\MiddlewareDispatcher), Object(Phpactor\LanguageServer\Core\Server\StreamProvider\Connection), Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage))
#38 [internal function]: Phpactor\LanguageServer\Core\Server\LanguageServer->Phpactor\LanguageServer\Core\Server\{closure}()
#39 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/amphp/amp/lib/Coroutine.php(118): Generator->send(Object(Phpactor\LanguageServer\Core\Rpc\RawMessage))
#40 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/amphp/amp/lib/Internal/Placeholder.php(149): Amp\Coroutine->Amp\{closure}(NULL, Object(Phpactor\LanguageServer\Core\Rpc\RawMessage))
#41 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/amphp/amp/lib/Coroutine.php(123): Amp\Coroutine->resolve(Object(Phpactor\LanguageServer\Core\Rpc\RawMessage))
#42 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/amphp/amp/lib/Internal/Placeholder.php(149): Amp\Coroutine->Amp\{closure}(NULL, 'Content-Length:...')
#43 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/amphp/amp/lib/Deferred.php(53): Amp\Promise@anonymous->resolve('Content-Length:...')
#44 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/amphp/byte-stream/lib/ResourceInputStream.php(101): Amp\Deferred->resolve('Content-Length:...')
#45 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/amphp/amp/lib/Loop/NativeDriver.php(327): Amp\ByteStream\ResourceInputStream::Amp\ByteStream\{closure}('a', Resource id #1, NULL)
#46 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/amphp/amp/lib/Loop/NativeDriver.php(127): Amp\Loop\NativeDriver->selectStreams(Array, Array, 0.1)
#47 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/amphp/amp/lib/Loop/Driver.php(138): Amp\Loop\NativeDriver->dispatch(true)
#48 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/amphp/amp/lib/Loop/Driver.php(72): Amp\Loop\Driver->tick()
#49 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/amphp/amp/lib/Loop.php(95): Amp\Loop\Driver->run()
#50 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/phpactor/language-server/lib/Core/Server/LanguageServer.php(113): Amp\Loop::run(Object(Closure))
#51 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/lib/Extension/LanguageServer/Command/StartCommand.php(50): Phpactor\LanguageServer\Core\Server\LanguageServer->run()
#52 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/symfony/console/Command/Command.php(298): Phpactor\Extension\LanguageServer\Command\StartCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#53 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#54 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand(Object(Phpactor\Extension\LanguageServer\Command\StartCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#55 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/lib/Application.php(48): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#56 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/vendor/symfony/console/Application.php(171): Phpactor\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#57 phar:///root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar/bin/phpactor(45): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#58 /root/.vscode-server/extensions/phpactor.vscode-phpactor-1.3.0/phpactor.phar(15): require('phar:///root/.v...')
#59 {main}