Repository navigation
Closed
Description
Hello!
Before I get started, thank you very much for Phpactor. It is a fantastic tool.
I've been hitting an issue when installing the RPC plugin for VIM. From what I can see it all comes down to optimizing the autoloader.
Plug 'phpactor/phpactor', {'for': 'php', 'branch': 'master', 'do': 'composer install --no-dev -o'}
This installs, but composer throws a bunch of warnings during installation...
...
Generating optimized autoload files
Warning: Ambiguous class resolution, "Phpactor\Extension\Php\PhpExtension" was found 2x: in "/Users/tim/.vim/plugged/phpactor/vendor/phpactor/php-extension/lib/PhpExtension.php" and "/Users/tim/.vim/plugged/phpactor/lib/Extension/Php/PhpExtension.php", the first will be used.
Warning: Ambiguous class resolution, "Phpactor\Extension\Php\Model\RuntimePhpVersionResolver" was found 2x: in "/Users/tim/.vim/plugged/phpactor/vendor/phpactor/php-extension/lib/Model/RuntimePhpVersionResolver.php" and "/Users/tim/.vim/plugged/phpactor/lib/Extension/Php/Model/RuntimePhpVersionResolver.php", the first will be used.
Warning: Ambiguous class resolution, "Phpactor\Extension\Php\Model\PhpVersionResolver" was found 2x: in "/Users/tim/.vim/plugged/phpactor/vendor/phpactor/php-extension/lib/Model/PhpVersionResolver.php" and "/Users/tim/.vim/plugged/phpactor/lib/Extension/Php/Model/PhpVersionResolver.php", the first will be used.
Warning: Ambiguous class resolution, "Phpactor\Extension\Php\Model\ConstantPhpVersionResolver" was found 2x: in "/Users/tim/.vim/plugged/phpactor/vendor/phpactor/php-extension/lib/Model/ConstantPhpVersionResolver.php" and "/Users/tim/.vim/plugged/phpactor/lib/Extension/Php/Model/ConstantPhpVersionResolver.php", the first will be used.
Warning: Ambiguous class resolution, "Phpactor\Extension\Php\Model\ChainResolver" was found 2x: in "/Users/tim/.vim/plugged/phpactor/vendor/phpactor/php-extension/lib/Model/ChainResolver.php" and "/Users/tim/.vim/plugged/phpactor/lib/Extension/Php/Model/ChainResolver.php", the first will be used.
Warning: Ambiguous class resolution, "Phpactor\Extension\Php\Model\ComposerPhpVersionResolver" was found 2x: in "/Users/tim/.vim/plugged/phpactor/vendor/phpactor/php-extension/lib/Model/ComposerPhpVersionResolver.php" and "/Users/tim/.vim/plugged/phpactor/lib/Extension/Php/Model/ComposerPhpVersionResolver.php", the first will be used.
Warning: Ambiguous class resolution, "LanguageServerProtocol\ServerCapabilities" was found 2x: in "/Users/tim/.vim/plugged/phpactor/vendor/felixfbecker/language-server-protocol/src/ServerCapabilities.php" and "/Users/tim/.vim/plugged/phpactor/vendor/phpactor/language-server/protocol/ServerCapabilities.php", the first will be used.
composer/package-versions-deprecated: Generating version class...
...
If I remove the -o everything works fine.
I'm not 100% sure how all this comes together, but I think these 3 files somehow create the conflict...
- https://github.com/felixfbecker/php-language-server-protocol/blob/master/src/ServerCapabilities.php
- https://github.com/phpactor/language-server-protocol/blob/master/src/ServerCapabilities.php
- https://github.com/phpactor/language-server/blob/27b51bddbe43bafa6d06710182b054c33dda5c54/composer.json#L38
As I mentioned, installing with -o resolves the problem the plugin works as expected. Let me know if I can gather any more information to help debug this or if this is a case of user error on my end.
Thanks.
Metadata
Metadata
Assignees
Labels
No labels
Activity
dantleech commentedon Oct 25, 2020
We can certainly remove the duplicated files.
Just to be clear this is not causing an error? it's just a warning?
camilledejoye commentedon Oct 25, 2020
@dantleech I don't think it causes any issue, I remember having messages like that years ago when I started using phpactor
Also, I guess it's safe to assume that at least you and I are not using the optimized autoloader during dev and we have no issue.
But it would be best to clean things up for sure.
Also worth mentioning, it's on master some are already solved in develop:
ServerCapabilitiesfor instance, the only actually after checking :)On develop:
[-]VIM RPC Plugin installation failure[/-][+]VIM RPC Plugin installation warnings[/+]timacdonald commentedon Oct 25, 2020
So I totally thought it was a failure because running
:PhpactorStatusfails, however this is an unrelated to the composer warnings and is becausephpactoris not globally accessible.I can confirm that these are just pesky composer warnings that do not cause an error like I first thought. Sorry for my misunderstanding. I've updated the issue to reflect that it is just warnings.
camilledejoye commentedon Oct 25, 2020
The
:PhpactorStatusissue was fixed on develop and will be available on master for the next release.timacdonald commentedon Oct 25, 2020
Nice! I just added my
~/.vim/plugged/binto my path and it solved the:PhpactorStatusthingo, but awesome to hear you've got it handled in the project!