Summary
Running scip-php on a real Laravel project on Windows exposed three related issues in the current runtime path:
- Composer autoload paths that end with
/ are only trimmed with DIRECTORY_SEPARATOR, so Windows projects can end up with projectFiles() === 0 and an empty index.scip.
- When
scip-php runs outside the target project's own vendor/, it can leave the target project's autoloader registered and accidentally mix the target app's nikic/php-parser with the indexer's own dependencies.
relative_path generation assumes / separators, so Windows artifacts can emit absolute paths instead of project-relative paths.
Repro
On a Laravel project on Windows:
- a global
scip-php run initially produced an empty index.scip
- after fixing the path trimming issue, the run crashed inside
PhpParser\\Node\\Expr\\Cast\\Int_::KIND_INT because the target project autoloader was still active and a different nikic/php-parser was loaded
- after isolating the autoloader, the produced artifact still emitted absolute Windows paths as
relative_path
Expected
projectFiles() should find the project's PHP files regardless of slash style in Composer metadata
- the indexer should keep using its own runtime dependencies even when it indexes a different project's
vendor/
- emitted
relative_path values should stay relative on Windows too
Notes
I have a minimal fix for all three in a downstream branch and can open a PR immediately.
Summary
Running
scip-phpon a real Laravel project on Windows exposed three related issues in the current runtime path:/are only trimmed withDIRECTORY_SEPARATOR, so Windows projects can end up withprojectFiles() === 0and an emptyindex.scip.scip-phpruns outside the target project's ownvendor/, it can leave the target project's autoloader registered and accidentally mix the target app'snikic/php-parserwith the indexer's own dependencies.relative_pathgeneration assumes/separators, so Windows artifacts can emit absolute paths instead of project-relative paths.Repro
On a Laravel project on Windows:
scip-phprun initially produced an emptyindex.scipPhpParser\\Node\\Expr\\Cast\\Int_::KIND_INTbecause the target project autoloader was still active and a differentnikic/php-parserwas loadedrelative_pathExpected
projectFiles()should find the project's PHP files regardless of slash style in Composer metadatavendor/relative_pathvalues should stay relative on Windows tooNotes
I have a minimal fix for all three in a downstream branch and can open a PR immediately.