Skip to content

Incorrect project root detection #941

@dantleech

Description

@dantleech
2020-04-06 09:05:46] phpactor.DEBUG: Resolved path "%application_root%/vendor/jetbrains/phpstorm-stubs" to "/home/daniel/www/phpactor/phpactor/vendor/jetbrains/phpstorm-stubs" [] []
[2020-04-06 09:05:46] phpactor.DEBUG: Resolved path "%cache%/worse-reflection" to "/home/daniel/.cache/phpactor/worse-reflection" [] []
[2020-04-06 09:05:46] phpactor.DEBUG: Resolved path "%project_root%/vendor/autoload.php" to "/home/daniel/www/inviqa/foobar-foobar/vendor/spryker-shop/catalog-page/vendor/autoload.php" [] []
[2020-04-06 09:05:46] phpactor.WARNING: Could not find autoloader "/home/daniel/www/inviqa/foobar-foobar/vendor/spryker-shop/catalog-page/vendor/autoload.php" [] []
[2020-04-06 09:05:46] phpactor.DEBUG: Resolved path "%project_root%" to "/home/daniel/www/inviqa/foobar-foobar/vendor/spryker-shop/catalog-page" [] []
[2020-04-06 09:05:46] phpactor.DEBUG: Resolved path "%cache%/index/%project_id%" to "/home/daniel/.cache/phpactor/index/catalog-page-f0ca3b" [] []

The vendor dir was resolved when trying to goto implemtnations instead of the project root.

The defaults root patterns are:

let g:phpactorProjectRootPatterns = get(g:, 'phpactorProjectRootPatterns', ['composer.json', '.git', '.phpactor.json', '.phpactor.yml'])

All of these could be matched in a vendor dir (the .phpactor ones being much less likely)

Any operation Phpactor attempts in third-party packages will likely not work. cc @przepompownia

Resolved by locally setting:

let g:phpactorProjectRootPatterns = []

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