Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The PHP Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. #779

Open
vermaysha opened this issue Apr 17, 2020 · 31 comments

Comments

@vermaysha
Copy link

Hello,
I'm getting this error since this morning an I do not know what caused or how to resolve it. I checked other similar problems and didn't get an answer there.

My PHP version is 7.3

CRITICAL  TypeError: Argument 2 passed to LanguageServer\Index\DependenciesIndex::setDependencyIndex() must be an instance of LanguageServer\Index\Index, bool given, called in /home/ashary/.vscode/extensions/felixfbecker.php-intellisense-2.3.13/vendor/felixfbecker/language-server/src/Indexer.php on line 164 and defined in /home/ashary/.vscode/extensions/felixfbecker.php-intellisense-2.3.13/vendor/felixfbecker/language-server/src/Index/DependenciesIndex.php:42

Stack trace:
#0 /home/ashary/.vscode/extensions/felixfbecker.php-intellisense-2.3.13/vendor/felixfbecker/language-server/src/Indexer.php(164): LanguageServer\Index\DependenciesIndex->setDependencyIndex('swiftmailer/swi...', false)
#1 [internal function]: LanguageServer\Indexer->LanguageServer\{closure}()
#2 /home/ashary/.vscode/extensions/felixfbecker.php-intellisense-2.3.13/vendor/sabre/event/lib/coroutine.php(70): Generator->send(false)
#3 /home/ashary/.vscode/extensions/felixfbecker.php-intellisense-2.3.13/vendor/sabre/event/lib/Promise.php(242): Sabre\Event\{closure}(false)
#4 /home/ashary/.vscode/extensions/felixfbecker.php-intellisense-2.3.13/vendor/sabre/event/lib/Loop/Loop.php(261): Sabre\Event\Promise->Sabre\Event\{closure}()
#5 /home/ashary/.vscode/extensions/felixfbecker.php-intellisense-2.3.13/vendor/sabre/event/lib/Loop/Loop.php(215): Sabre\Event\Loop\Loop->runNextTicks()
#6 /home/ashary/.vscode/extensions/felixfbecker.php-intellisense-2.3.13/vendor/sabre/event/lib/Loop/Loop.php(194): Sabre\Event\Loop\Loop->tick(true)
#7 /home/ashary/.vscode/extensions/felixfbecker.php-intellisense-2.3.13/vendor/sabre/event/lib/Loop/functions.php(122): Sabre\Event\Loop\Loop->run()
#8 /home/ashary/.vscode/extensions/felixfbecker.php-intellisense-2.3.13/vendor/felixfbecker/language-server/bin/php-language-server.php(55): Sabre\Event\Loop\run()
#9 {main}

[Info  - 6:04:31 PM] Restored filp/whoops:2.7.0 from cache
[Info  - 6:04:31 PM] Restored vlucas/phpdotenv:3.6.0 from cache
[Info  - 6:04:31 PM] Restored paragonie/random_compat:9.99.99 from cache
[Error - 6:04:31 PM] Connection to server got closed. Server will not be restarted.
DEBUG     Restarted process exited 0
@khanks
Copy link

khanks commented May 19, 2020

Looks like you're not going to get any answer or comment from the author on this. I used to think it was because I frequently opened Vscode without running a web server, because I just wanted to browse. But I realized it also happens when the webserver IS running. And it always gives the same stupid message about " 5 times in the last 3 minutes" -- even if I opened vscode less than a minute ago.

@mxdpeep
Copy link

mxdpeep commented Dec 3, 2020

Looks like you're not going to get any answer or comment from the author on this. I used to think it was because I frequently opened Vscode without running a web server, because I just wanted to browse. But I realized it also happens when the webserver IS running. And it always gives the same stupid message about " 5 times in the last 3 minutes" -- even if I opened vscode less than a minute ago.

this is quite stupid

@mxdpeep
Copy link

mxdpeep commented Dec 3, 2020

I got the same error just right after opening VSCode.
PHP 8.0RCwhateverfuck.

@larsmaes
Copy link

larsmaes commented Dec 30, 2020

Got something similar:

CRITICAL  Error: Call to undefined method Microsoft\PhpParser\MissingToken::getResolvedName() in C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\felixfbecker\language-server\src\DefinitionResolver.php:1033
Stack trace:
#0 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\felixfbecker\language-server\src\DefinitionResolver.php(815): LanguageServer\DefinitionResolver->resolveClassNameToType()
#1 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\felixfbecker\language-server\src\DefinitionResolver.php(827): LanguageServer\DefinitionResolver->resolveExpressionNodeToType()
#2 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\felixfbecker\language-server\src\DefinitionResolver.php(682): LanguageServer\DefinitionResolver->resolveExpressionNodeToType()
#3 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\felixfbecker\language-server\src\DefinitionResolver.php(404): LanguageServer\DefinitionResolver->resolveExpressionNodeToType()
#4 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\felixfbecker\language-server\src\DefinitionResolver.php(331): LanguageServer\DefinitionResolver->resolveMemberAccessExpressionNodeToFqn()
#5 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\felixfbecker\language-server\src\TreeAnalyzer.php(175): LanguageServer\DefinitionResolver->resolveReferenceNodeToFqn()
#6 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\felixfbecker\language-server\src\TreeAnalyzer.php(124): LanguageServer\TreeAnalyzer->collectDefinitionsAndReferences()
#7 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\felixfbecker\language-server\src\TreeAnalyzer.php(140): LanguageServer\TreeAnalyzer->traverse()
#8 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\felixfbecker\language-server\src\TreeAnalyzer.php(140): LanguageServer\TreeAnalyzer->traverse()
#9 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\felixfbecker\language-server\src\TreeAnalyzer.php(136): LanguageServer\TreeAnalyzer->traverse()
#10 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\felixfbecker\language-server\src\TreeAnalyzer.php(140): LanguageServer\TreeAnalyzer->traverse()
#11 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\felixfbecker\language-server\src\TreeAnalyzer.php(136): LanguageServer\TreeAnalyzer->traverse()
#12 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\felixfbecker\language-server\src\TreeAnalyzer.php(140): LanguageServer\TreeAnalyzer->traverse()
#13 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\felixfbecker\language-server\src\TreeAnalyzer.php(136): LanguageServer\TreeAnalyzer->traverse()
#14 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\felixfbecker\language-server\src\TreeAnalyzer.php(58): LanguageServer\TreeAnalyzer->traverse()
#15 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\felixfbecker\language-server\src\PhpDocument.php(147): LanguageServer\TreeAnalyzer->__construct()
#16 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\felixfbecker\language-server\src\PhpDocument.php(105): LanguageServer\PhpDocument->updateContent()
#17 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\felixfbecker\language-server\src\PhpDocumentLoader.php(141): LanguageServer\PhpDocument->__construct()
#18 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\felixfbecker\language-server\src\PhpDocumentLoader.php(120): LanguageServer\PhpDocumentLoader->create()
#19 [internal function]: LanguageServer\PhpDocumentLoader->LanguageServer\{closure}()
#20 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\sabre\event\lib\coroutine.php(70): Generator->send()
#21 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\sabre\event\lib\Promise.php(242): Sabre\Event\{closure}()
#22 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\sabre\event\lib\Loop\Loop.php(261): Sabre\Event\Promise->Sabre\Event\{closure}()
#23 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\sabre\event\lib\Loop\Loop.php(215): Sabre\Event\Loop\Loop->runNextTicks()
#24 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\sabre\event\lib\Loop\Loop.php(194): Sabre\Event\Loop\Loop->tick()
#25 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\sabre\event\lib\Loop\functions.php(122): Sabre\Event\Loop\Loop->run()
#26 C:\Users\lars\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\felixfbecker\language-server\bin\php-language-server.php(55): Sabre\Event\Loop\run()
#27 {main}

php --version:
PHP 8.0.0 (cli) (built: Nov 24 2020 22:02:58) ( NTS Visual C++ 2019 x64 )
Copyright (c) The PHP Group
Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies

@spantaleev
Copy link

I'm hitting the same issue on PHP 8.0.2 (Archlinux).

CRITICAL Error: Call to undefined method Microsoft\PhpParser\MissingToken::getResolvedName() in /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/DefinitionResolver.php:1033

#0 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/DefinitionResolver.php(815): LanguageServer\DefinitionResolver->resolveClassNameToType(Object(Microsoft\PhpParser\MissingToken))
#1 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/DefinitionResolver.php(827): LanguageServer\DefinitionResolver->resolveExpressionNodeToType(Object(Microsoft\PhpParser\Node\Expression\ObjectCreationExpression))
#2 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/DefinitionResolver.php(682): LanguageServer\DefinitionResolver->resolveExpressionNodeToType(Object(Microsoft\PhpParser\Node\Expression\AssignmentExpression))
#3 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/DefinitionResolver.php(404): LanguageServer\DefinitionResolver->resolveExpressionNodeToType(Object(Microsoft\PhpParser\Node\Expression\Variable))
#4 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/DefinitionResolver.php(331): LanguageServer\DefinitionResolver->resolveMemberAccessExpressionNodeToFqn(Object(Microsoft\PhpParser\Node\Expression\MemberAccessExpression))
#5 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(175): LanguageServer\DefinitionResolver->resolveReferenceNodeToFqn(Object(Microsoft\PhpParser\Node\Expression\MemberAccessExpression))
#6 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(124): LanguageServer\TreeAnalyzer->collectDefinitionsAndReferences(Object(Microsoft\PhpParser\Node\Expression\MemberAccessExpression))
#7 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(140): LanguageServer\TreeAnalyzer->traverse(Object(Microsoft\PhpParser\Node\Expression\MemberAccessExpression))
#8 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(140): LanguageServer\TreeAnalyzer->traverse(Object(Microsoft\PhpParser\Node\Expression\CallExpression))
#9 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(136): LanguageServer\TreeAnalyzer->traverse(Object(Microsoft\PhpParser\Node\Statement\ExpressionStatement))
#10 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(140): LanguageServer\TreeAnalyzer->traverse(Object(Microsoft\PhpParser\Node\Statement\CompoundStatementNode))
#11 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(136): LanguageServer\TreeAnalyzer->traverse(Object(Microsoft\PhpParser\Node\MethodDeclaration))
#12 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(140): LanguageServer\TreeAnalyzer->traverse(Object(Microsoft\PhpParser\Node\ClassMembersNode))
#13 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(136): LanguageServer\TreeAnalyzer->traverse(Object(Microsoft\PhpParser\Node\Statement\ClassDeclaration))
#14 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(58): LanguageServer\TreeAnalyzer->traverse(Object(Microsoft\PhpParser\Node\SourceFileNode))
#15 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/PhpDocument.php(147): LanguageServer\TreeAnalyzer->__construct(Object(Microsoft\PhpParser\Parser), '<?php\nclass App...', Object(phpDocumentor\Reflection\DocBlockFactory), Object(LanguageServer\DefinitionResolver), 'file:///mnt/ssh...')
#16 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/PhpDocument.php(105): LanguageServer\PhpDocument->updateContent('<?php\nclass App...')
#17 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/PhpDocumentLoader.php(141): LanguageServer\PhpDocument->__construct('file:///mnt/ssh...', '<?php\nclass App...', Object(LanguageServer\Index\Index), Object(Microsoft\PhpParser\Parser), Object(phpDocumentor\Reflection\DocBlockFactory), Object(LanguageServer\DefinitionResolver))
#18 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/PhpDocumentLoader.php(120): LanguageServer\PhpDocumentLoader->create('file:///mnt/ssh...', '<?php\nclass App...')
#19 [internal function]: LanguageServer\PhpDocumentLoader->LanguageServer\{closure}()
#20 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/sabre/event/lib/coroutine.php(70): Generator->send('<?php\nclass App...')
#21 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/sabre/event/lib/Promise.php(242): Sabre\Event\{closure}('<?php\nclass App...')
#22 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/sabre/event/lib/Loop/Loop.php(261): Sabre\Event\Promise->Sabre\Event\{closure}()
#23 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/sabre/event/lib/Loop/Loop.php(215): Sabre\Event\Loop\Loop->runNextTicks()
#24 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/sabre/event/lib/Loop/Loop.php(194): Sabre\Event\Loop\Loop->tick(true)
#25 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/sabre/event/lib/Loop/functions.php(122): Sabre\Event\Loop\Loop->run()
#26 /home/user/.vscode-oss/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/bin/php-language-server.php(55): Sabre\Event\Loop\run()
#27 {main}

@AndrewPam
Copy link

I have the same issue with PHP 8.0.2 on Ubuntu 20.04

@retry19
Copy link

retry19 commented Feb 13, 2021

I have teh same issue after update PHP version to 8.0.2.

  • OS : Manjaro OS
  • Kernel : 5.10.15-1 Manjaro
  • PHP : 8.0.2 (cli) (built: Feb 2 2021 18:26:02) (NTS)
PHP Language Server: CRITICAL  Error: Call to undefined method Microsoft\PhpParser\MissingToken::getResolvedName() in /home/re_try19/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/DefinitionResolver.php:1033
Stack trace:
#0 /home/re_try19/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/DefinitionResolver.php(815): LanguageServer\DefinitionResolver->resolveClassNameToType()
#1 /home/re_try19/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/DefinitionResolver.php(827): LanguageServer\DefinitionResolver->resolveExpressionNodeToType()
#2 /home/re_try19/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/DefinitionResolver.php(682): LanguageServer\DefinitionResolver->resolveExpressionNodeToType()
#3 /home/re_try19/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/DefinitionResolver.php(404): LanguageServer\DefinitionResolver->resolveExpressionNodeToType()
#4 /home/re_try19/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/DefinitionResolver.php(331): LanguageServer\DefinitionResolver->resolveMemberAccessExpressionNodeToFqn()
#5 /home/re_try19/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(175): LanguageServer\DefinitionResolver->resolveReferenceNodeToFqn()
#6 /home/re_try19/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(124): LanguageServer\TreeAnalyzer->collectDefinitionsAndReferences()
#7 /home/re_try19/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(140): LanguageServer\TreeAnalyzer->traverse()
#8 /home/re_try19/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(140): LanguageServer\TreeAnalyzer->traverse()
#9 /home/re_try19/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(136): LanguageServer\TreeAnalyzer->traverse()
#10 /home/re_try19/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(58): LanguageServer\TreeAnalyzer->traverse()
#11 /home/re_try19/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/PhpDocument.php(147): LanguageServer\TreeAnalyzer->__construct()
#12 /home/re_try19/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/PhpDocument.php(105): LanguageServer\PhpDocument->updateContent()
#13 /home/re_try19/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/PhpDocumentLoader.php(141): LanguageServer\PhpDocument->__construct()
#14 /home/re_try19/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/PhpDocumentLoader.php(120): LanguageServer\PhpDocumentLoader->create()
#15 [internal function]: LanguageServer\PhpDocumentLoader->LanguageServer\{closure}()
#16 /home/re_try19/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/vendor/sabre/event/lib/coroutine.php(70): Generator->send()
#17 /home/re_try19/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/vendor/sabre/event/lib/Promise.php(242): Sabre\Event\{closure}()
#18 /home/re_try19/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/vendor/sabre/event/lib/Loop/Loop.php(261): Sabre\Event\Promise->Sabre\Event\{closure}()
#19 /home/re_try19/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/vendor/sabre/event/lib/Loop/Loop.php(215): Sabre\Event\Loop\Loop->runNextTicks()
#20 /home/re_try19/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/vendor/sabre/event/lib/Loop/Loop.php(194): Sabre\Event\Loop\Loop->tick()
#21 /home/re_try19/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/vendor/sabre/event/lib/Loop/functions.php(122): Sabre\Event\Loop\Loop->run()
#22 /home/re_try19/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/bin/php-language-server.php(55): Sabre\Event\Loop\run()
#23 {main}

@guilty-p01nt3r
Copy link

Same here

  • OS: Ubuntu 20.04.02 LTS (on VirtualBox)
  • PHP 8.0.2 (cli) (built: Feb 7 2021 12:22:16) ( NTS )
    Zend Engine v4.0.2, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.2, Copyright (c), by Zend Technologies
    with Xdebug v3.0.2, Copyright (c) 2002-2021, by Derick Rethans
PHP Language Server: CRITICAL  Error: Call to undefined method Microsoft\PhpParser\MissingToken::getResolvedName() in /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/DefinitionResolver.php:1033
Stack trace:
#0 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/DefinitionResolver.php(815): LanguageServer\DefinitionResolver->resolveClassNameToType()
#1 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/DefinitionResolver.php(827): LanguageServer\DefinitionResolver->resolveExpressionNodeToType()
#2 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/DefinitionResolver.php(682): LanguageServer\DefinitionResolver->resolveExpressionNodeToType()
#3 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/DefinitionResolver.php(404): LanguageServer\DefinitionResolver->resolveExpressionNodeToType()
#4 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/DefinitionResolver.php(331): LanguageServer\DefinitionResolver->resolveMemberAccessExpressionNodeToFqn()
#5 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(175): LanguageServer\DefinitionResolver->resolveReferenceNodeToFqn()
#6 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(124): LanguageServer\TreeAnalyzer->collectDefinitionsAndReferences()
#7 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(140): LanguageServer\TreeAnalyzer->traverse()
#8 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(140): LanguageServer\TreeAnalyzer->traverse()
#9 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(136): LanguageServer\TreeAnalyzer->traverse()
#10 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(140): LanguageServer\TreeAnalyzer->traverse()
#11 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(136): LanguageServer\TreeAnalyzer->traverse()
#12 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(140): LanguageServer\TreeAnalyzer->traverse()
#13 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(140): LanguageServer\TreeAnalyzer->traverse()
#14 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(136): LanguageServer\TreeAnalyzer->traverse()
#15 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(140): LanguageServer\TreeAnalyzer->traverse()
#16 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(136): LanguageServer\TreeAnalyzer->traverse()
#17 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(140): LanguageServer\TreeAnalyzer->traverse()
#18 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(136): LanguageServer\TreeAnalyzer->traverse()
#19 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/TreeAnalyzer.php(58): LanguageServer\TreeAnalyzer->traverse()
#20 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/PhpDocument.php(147): LanguageServer\TreeAnalyzer->__construct()
#21 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/PhpDocument.php(105): LanguageServer\PhpDocument->updateContent()
#22 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/PhpDocumentLoader.php(141): LanguageServer\PhpDocument->__construct()
#23 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/PhpDocumentLoader.php(120): LanguageServer\PhpDocumentLoader->create()
#24 [internal function]: LanguageServer\PhpDocumentLoader->LanguageServer\{closure}()
#25 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/sabre/event/lib/coroutine.php(70): Generator->send()
#26 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/sabre/event/lib/Promise.php(242): Sabre\Event\{closure}()
#27 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/sabre/event/lib/Loop/Loop.php(261): Sabre\Event\Promise->Sabre\Event\{closure}()
#28 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/sabre/event/lib/Loop/Loop.php(215): Sabre\Event\Loop\Loop->runNextTicks()
#29 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/sabre/event/lib/Loop/Loop.php(194): Sabre\Event\Loop\Loop->tick()
#30 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/sabre/event/lib/Loop/functions.php(122): Sabre\Event\Loop\Loop->run()
#31 /home/webserver/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/bin/php-language-server.php(55): Sabre\Event\Loop\run()
#32 {main}

@eojeel
Copy link

eojeel commented Feb 23, 2021

Same issue

CRITICAL TypeError: Argument 2 passed to LanguageServer\Index\DependenciesIndex::setDependencyIndex() must be an instance of LanguageServer\Index\Index, bool given, called in /home/******/.vscode-server/extensions/felixfbecker.php-intellisense-2.3.13/vendor/felixfbecker/language-server/src/Indexer.php on line 164 and defined in

php 7.3
vs code on WSL

UPDATE

Fixed via a reset of VS code.
Cleansed all extensions.
ensured all dangling files removed from ~/.vscode/extensions in WSL.
re-installed extensions.

Working as expected.

@TimHuey
Copy link

TimHuey commented Feb 25, 2021

Same error...
Ubuntu 20.04
PHP 8.0.2
Apache2 disabled
Valet running 2.2.19

VSCode fresh install
PHP Language Server: CRITICAL Error: Call to undefined method Microsoft\PhpParser\MissingToken::getResolvedName() in /home/tim/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/vendor/felixfbecker/language-server/src/DefinitionResolver.php:1033

@FaycalBorsali
Copy link

Please, if anyone ever fixes the issue, let us know

I am also on Ubuntu 20.04, having PHP 8 and running Valet

@TimHuey
Copy link

TimHuey commented Mar 8, 2021

I wonder if uninstalling valet and enabling Apache2 would fix the problem.

@TgMrP
Copy link

TgMrP commented Mar 16, 2021

Same here

PHP 8.0.3 (cli) (built: Mar  5 2021 07:53:56) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.3, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.3, Copyright (c), by Zend Technologies
    with Xdebug v3.0.3, Copyright (c) 2002-2021, by Derick Rethans

@TgMrP
Copy link

TgMrP commented Mar 16, 2021

In my case, running composer update inside the extension folder solve the problem :)

cd ~/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/

composer update

@TimHuey
Copy link

TimHuey commented Mar 16, 2021

In my case, running composer update inside the extension folder solve the problem :)

cd ~/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/

composer update

That seems to have done it for me as well. I will keep an eye out but I re-enabled it and restarted VSCODE and didn't get the popup error saying it had crashed anymore. WOoohooo THANKS.

@tertek
Copy link

tertek commented Mar 25, 2021

In my case, running composer update inside the extension folder solve the problem :)

cd ~/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/

composer update

Thank you for sharing this. Solved the issue on my system:

PHP 8.0.3 (cli) (built: Mar  2 2021 23:34:05) ( ZTS Visual C++ 2019 x64 )
Copyright (c) The PHP Group
Zend Engine v4.0.3, Copyright (c) Zend Technologies
with Xdebug v3.0.3, Copyright (c) 2002-2021, by Derick Rethans

@TimHuey
Copy link

TimHuey commented Mar 25, 2021

I don't want to

In my case, running composer update inside the extension folder solve the problem :)

cd ~/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/

composer update

I really hate showing how new I am to all of this. But it may help to understand what this exactly did to fix it as it might be useful for other such problems with other packages and extensions. What did the command composer update do when executed in the particular extensions directory.

@roadrunnor
Copy link

For me too, running composer update inside the extension folder solve the problem :)
Thanks TgMrP

@amasotti
Copy link

In my case, running composer update inside the extension folder solve the problem :)

cd ~/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/

composer update

This worked! Thanks :)

@Geekimo
Copy link

Geekimo commented May 27, 2021

Thanks ! The composer update trick worked fine :)

@james090500
Copy link

I don't want to

In my case, running composer update inside the extension folder solve the problem :)

cd ~/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/

composer update

I really hate showing how new I am to all of this. But it may help to understand what this exactly did to fix it as it might be useful for other such problems with other packages and extensions. What did the command composer update do when executed in the particular extensions directory.

Composer is a PHP package manager. Running composer update in the package folder basically updated all of the packages the plugin uses to a newer version.

@salimibrohimi
Copy link

salimibrohimi commented Jun 22, 2021

In my case, running composer update inside the extension folder solve the problem :)

cd ~/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/

composer update

I'm getting a lot of:
Deprecation Notice: Method ReflectionParameter::getClass() is deprecated

I'm on Manjaro, PHP 8.0.7

UPDATE: Okay, patience is rewarded.
The extension works now, but it consumes too much resources (CPU)... This extension sucks. Every time I open a new file my fan sound like a plane.

@SaedyMoz
Copy link

i got this error. and when i update package with composer return same error in cmd Infinitely.

errot

@TimHuey
Copy link

TimHuey commented Jun 22, 2021 via email

@ericmaster
Copy link

I'm using Code Server (https://github.com/cdr/code-server) on Oracle Linux 8 with PHP 8.0.9 and was getting the same issue. I confirm that executing composer update in the extension directory seems to have fixed this.

@msrumon
Copy link

msrumon commented Aug 30, 2021

In my case, running composer update inside the extension folder solve the problem :)

cd ~/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/

composer update

Thanks! This worked for my Windows 10 Pro 21H1 machine running PHP 8.0.8.

@JonDelWeb
Copy link

In my case, running composer update inside the extension folder solve the problem :)

cd ~/.vscode/extensions/felixfbecker.php-intellisense-2.3.14/

composer update

That's doesn't work for me... I'm getting this error :

`PHP Fatal error: Uncaught ArgumentCountError: array_merge() does not accept unknown named parameters in /usr/share/php/Composer/DependencyResolver/DefaultPolicy.php:84

Stack trace:
#0 [internal function]: array_merge()
#1 /usr/share/php/Composer/DependencyResolver/DefaultPolicy.php(84): call_user_func_array()
#2 /usr/share/php/Composer/Installer.php(1021): Composer\DependencyResolver\DefaultPolicy->selectPreferredPackages()
#3 /usr/share/php/Composer/Installer.php(467): Composer\Installer->processDevPackages()
#4 /usr/share/php/Composer/Installer.php(227): Composer\Installer->doInstall()
#5 /usr/share/php/Composer/Command/UpdateCommand.php(161): Composer\Installer->run()
#6 /usr/share/php/Symfony/Component/Console/Command/Command.php(252): Composer\Command\UpdateCommand->execute()
#7 /usr/share/php/Symfony/Component/Console/Application.php(946): Symfony\Component\Console\Command\Command->run()
#8 /usr/share/php/Symfony/Component/Console/Application.php(248): Symfony\Component\Console\Application->doRunCommand()
#9 /usr/share/php/Composer/Console/Application.php(251): Symfony\Component\Console\Application->doRun()
#10 /usr/share/php/Symfony/Component/Console/Application.php(148): Composer\Console\Application->doRun()
#11 /usr/share/php/Composer/Console/Application.php(100): Symfony\Component\Console\Application->run()
#12 /usr/bin/composer(59): Composer\Console\Application->run()
#13 {main}
thrown in /usr/share/php/Composer/DependencyResolver/DefaultPolicy.php on line 84`

Kubuntu 18.04
Php 8.0.10
VSCode 1.60.1

Any idea ?

@shabayekdes
Copy link

shabayekdes commented Oct 26, 2021

Open this directory
C:\Users\{USER}\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\felixfbecker\language-server

open composer.js and change line
"phpdocumentor/reflection-docblock": "^4.0.0", to "phpdocumentor/reflection-docblock": "^5.3.0",

download latest version of source code from ReflectionDocBlock
unzip folder in
C:\Users\shaba\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\phpdocumentor\reflection-docblock
Note don't forget to change {USER} to your name pc
thanks

guoyunhe added a commit to guoyunhe/php-language-server that referenced this issue Nov 6, 2021
@kde99
Copy link

kde99 commented Feb 1, 2022

Still not fixed and composer update does nothing same error after.

PHP 8.1.2 (cli) (built: Jan 24 2022 10:43:09) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.2, Copyright (c), by Zend Technologies

@DunriteClub
Copy link

DunriteClub commented Feb 9, 2022

I just set up mine tonight and had all kinds of errors. After I declared the PHP executable path in settings.json some errors went away and new ones came. Uninstall Intellisense or whatever pops up in the dialog box (click the Gear icon). Then restart VScode and make sure no errors, then add back the Extensions. Probably because they were all written for 7.x and we are now on 8.0 would be my guess.

@zobo
Copy link

zobo commented Mar 31, 2022

I published an updated version of this project as this one is abandoned.
https://marketplace.visualstudio.com/items?itemName=zobo.php-intellisense
https://github.com/zobo/php-language-server
https://github.com/zobo/vscode-php-intellisense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests