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

TypeError: Argument 2 passed to LanguageServer\Index\DependenciesIndex::setDependencyIndex() must be an instance of LanguageServer\Index\Index, boolean given #751

Open
pelallemant opened this issue Aug 2, 2019 · 1 comment

Comments

@pelallemant
Copy link

Hi,

I'm using atom ide-php and it doesn't work on some projects.

I was able to create a minimal example of project which crash with that error.

context/WebContent.php

<?php

use Behat\MinkExtension\Context\MinkContext;

class WebContext extends MinkContext
{
  
}

composer.json

{
    "name": "php-langserver-test/behat",
    "require": {
      "behat/behat": "^3.5",
      "behat/mink": "^1.7",
      "behat/mink-extension": "^2.3"
    }
}

I end with an atom error notification telling that the amount of allowed restart of php-langserver for this project has been exceeded.

Here is a piece of logs:

PHP (FelixFBecker) stderr CRITICAL  TypeError: Argument 2 passed to LanguageServer\Index\DependenciesIndex::setDependencyIndex() must be an instance of LanguageServer\Index\Index, boolean given, called in /home/pierre-emmanuel/.atom/packages/ide-php/vendor/felixfbecker/language-server/src/Indexer.php on line 164 and defined in /home/pierre-emmanuel/.atom/packages/ide-php/vendor/felixfbecker/language-server/src/Index/DependenciesIndex.php:42
@primitive-mike
Copy link

Same here, in VS Code.

Here's the error and stack trace:

CRITICAL TypeError: Argument 2 passed to LanguageServer\Index\DependenciesIndex::setDependencyIndex() must be an instance of LanguageServer\Index\Index, bool given, called in C:\Users\lemon.vscode\extensions\felixfbecker.php-intellisense-2.3.13\vendor\felixfbecker\language-server\src\Indexer.php on line 164 and defined in C:\Users\lemon.vscode\extensions\felixfbecker.php-intellisense-2.3.13\vendor\felixfbecker\language-server\src\Index\DependenciesIndex.php:42
Stack trace:
#0 C:\Users\lemon.vscode\extensions\felixfbecker.php-intellisense-2.3.13\vendor\felixfbecker\language-server\src\Indexer.php(164): LanguageServer\Index\DependenciesIndex->setDependencyIndex('sebastian/compa...', false)
#1 [internal function]: LanguageServer\Indexer->LanguageServer{closure}()
#2 C:\Users\lemon.vscode\extensions\felixfbecker.php-intellisense-2.3.13\vendor\sabre\event\lib\coroutine.php(70): Generator->send(false)
#3 C:\Users\lemon.vscode\extensions\felixfbecker.php-intellisense-2.3.13\vendor\sabre\event\lib\Promise.php(242): Sabre\Event{closure}(false)
#4 C:\Users\lemon.vscode\extensions\felixfbecker.php-intellisense-2.3.13\vendor\sabre\event\lib\Loop\Loop.php(261): Sabre\Event\Promise->Sabre\Event{closure}()
#5 C:\Users\lemon.vscode\extensions\felixfbecker.php-intellisense-2.3.13\vendor\sabre\event\lib\Loop\Loop.php(215): Sabre\Event\Loop\Loop->runNextTicks()
#6 C:\Users\lemon.vscode\extensions\felixfbecker.php-intellisense-2.3.13\vendor\sabre\event\lib\Loop\Loop.php(194): Sabre\Event\Loop\Loop->tick(true)
#7 C:\Users\lemon.vscode\extensions\felixfbecker.php-intellisense-2.3.13\vendor\sabre\event\lib\Loop\functions.php(122): Sabre\Event\Loop\Loop->run()
#8 C:\Users\lemon.vscode\extensions\felixfbecker.php-intellisense-2.3.13\vendor\felixfbecker\language-server\bin\php-language-server.php(55): Sabre\Event\Loop\run()
#9 {main}

[Error - 8:38:29 AM] Connection to server got closed. Server will not be restarted.
Language server exited with exit code 0

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

2 participants