Navigator: Fix attempt to create existing destination#2776
Navigator: Fix attempt to create existing destination#2776dantleech merged 8 commits intophpactor:masterfrom
Conversation
| FilePathResolverExtension::class, | ||
| WorseReflectionExtension::class, | ||
| ], array_merge([ | ||
| LoggingExtension::PARAM_ENABLED=> true, |
There was a problem hiding this comment.
Either disable or examine why this warning is even produced: https://github.com/phpactor/phpactor/actions/runs/11846687499/job/33014838113?pr=2776#step:5:235
There was a problem hiding this comment.
because the COMPOSER_AUTOLOADER path is based on the APPLICATION_ROOT perhaps?
The reason these integration test cases all over the place is because these were originally separate packages. At some level it would make sense to have a single "Phpactor" IntegrationTestCase providing the workspace + container, or maybe a better way to bootstrap it but it's not a trivial thing to do at this scale.
There was a problem hiding this comment.
In IntegrationTestCase I disabled composer extension
|
can you summarise what the problem was and how this fixes it? |
|
Using RPC command to navigate between files by pattern (like go to test/go to source) with file autocreation method enabled always resulted in a prompt asking for creating a target file, even though it might already exist. This happened, because destination file was provided as path relative to current working directory (directly from user setting, like The fix simply resolves to absolute path to avoid any disambiguity. It is applied at the latest possible stage, affecting both checking for the need to create a file and the target destination delivered back from the RPC command. |
|
Are you using the PHAR? (I don't get this issue, but it sounds like a PHAR thing) |
Look at the videos attached in #2758 And yes, it does appear when using phpactor built as PHAR. But the test suite somewhat confirms the issue (yet that may be another way of mangling paths). |
549cd09 to
9da308b
Compare
Remove false-positive file creation attempt by resolving absolute path of destination. Introduce rough set of tests for that, for further refinement. Signed-off-by: Bart Jaskulski <[email protected]>
Signed-off-by: Bart Jaskulski <[email protected]>
Signed-off-by: Bart Jaskulski <[email protected]>
Signed-off-by: Bart Jaskulski <[email protected]>
Signed-off-by: Bart Jaskulski <[email protected]>
Signed-off-by: Bart Jaskulski <[email protected]>
Signed-off-by: Bart Jaskulski <[email protected]>
Signed-off-by: Bart Jaskulski <[email protected]>
c675b24 to
4244f23
Compare
|
failure in latest PHPUnit seems to be false-positive -- related to indexer and I don't experience it locally (even when running in PHP 8.2) |
|
yes, that test has been flakey for years, thanks :) |
Remove false-positive file creation attempt by resolving absolute path of destination. Introduce a rough set of tests for that, for further refinement.
Fix #2758