Skip to content

VIM RPC Plugin installation warnings #1115

Closed

Description

@timacdonald

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...

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.

Activity

  1. dantleech commented on Oct 25, 2020

    @dantleech
    Collaborator

    We can certainly remove the duplicated files.

    Just to be clear this is not causing an error? it's just a warning?

  2. camilledejoye commented on Oct 25, 2020

    @camilledejoye
    Contributor

    If I remove the -o everything works fine.
    As I mentioned, installing with -o resolves the problem
    I think there is mistake here ;)

    @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: ServerCapabilities for instance, the only actually after checking :)
    On develop:

    Warning: Ambiguous class resolution, "Phpactor\Extension\Php\PhpExtension" was found 2x: in "/media/ewilan/php/phpactor/phpactor/vendor/phpactor/php-extension/lib/PhpExtension.php" and "/media/ewilan/php/phpactor/phpactor/lib/Extension/Php/PhpExtension.php", the first will be used.
    Warning: Ambiguous class resolution, "Phpactor\Extension\Php\Model\RuntimePhpVersionResolver" was found 2x: in "/media/ewilan/php/phpactor/phpactor/vendor/phpactor/php-extension/lib/Model/RuntimePhpVersionResolver.php" and "/media/ewilan/php/phpactor/phpactor/lib/Extension/Php/Model/RuntimePhpVersionResolver.php", the first will be used.
    Warning: Ambiguous class resolution, "Phpactor\Extension\Php\Model\ChainResolver" was found 2x: in "/media/ewilan/php/phpactor/phpactor/vendor/phpactor/php-extension/lib/Model/ChainResolver.php" and "/media/ewilan/php/phpactor/phpactor/lib/Extension/Php/Model/ChainResolver.php", the first will be used.
    Warning: Ambiguous class resolution, "Phpactor\Extension\Php\Model\ConstantPhpVersionResolver" was found 2x: in "/media/ewilan/php/phpactor/phpactor/vendor/phpactor/php-extension/lib/Model/ConstantPhpVersionResolver.php" and "/media/ewilan/php/phpactor/phpactor/lib/Extension/Php/Model/ConstantPhpVersionResolver.php", the first will be used.
    Warning: Ambiguous class resolution, "Phpactor\Extension\Php\Model\ComposerPhpVersionResolver" was found 2x: in "/media/ewilan/php/phpactor/phpactor/vendor/phpactor/php-extension/lib/Model/ComposerPhpVersionResolver.php" and "/media/ewilan/php/phpactor/phpactor/lib/Extension/Php/Model/ComposerPhpVersionResolver.php", the first will be used.
    Warning: Ambiguous class resolution, "Phpactor\Extension\Php\Model\PhpVersionResolver" was found 2x: in "/media/ewilan/php/phpactor/phpactor/vendor/phpactor/php-extension/lib/Model/PhpVersionResolver.php" and "/media/ewilan/php/phpactor/phpactor/lib/Extension/Php/Model/PhpVersionResolver.php", the first will be used.
    
  3. changed the title [-]VIM RPC Plugin installation failure[/-] [+]VIM RPC Plugin installation warnings[/+] on Oct 25, 2020
  4. timacdonald commented on Oct 25, 2020

    @timacdonald
    Author

    So I totally thought it was a failure because running :PhpactorStatus fails, however this is an unrelated to the composer warnings and is becausephpactor is 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.

  5. camilledejoye commented on Oct 25, 2020

    @camilledejoye
    Contributor

    The :PhpactorStatus issue was fixed on develop and will be available on master for the next release.

  6. timacdonald commented on Oct 25, 2020

    @timacdonald
    Author

    Nice! I just added my ~/.vim/plugged/bin to my path and it solved the :PhpactorStatus thingo, but awesome to hear you've got it handled in the project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions