Fix editorUrl functionality #1661
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Yesterday I tried to use the new "editor url" functionality in my main project, only to find that it does not really work as expected 😞 . Since our project uses the Symfony console component, the same that Rector and PHPStan use, I had assumed that
<href=links would be transformed by the console component in the same way as in those tools, so that this would be converted to the proper escape codes that actually show a link in the console. But our project uses a custom console formatter which is much simpler than the standard Symfony formatter and this conversion is not done. So our href links end up being printed verbatim to the console instead of being converted to proper links.I feel a bit stupid about this because I would have sworn that I had actually tested this output in the console, but obviously I didn't. And the tests themselves should have told me that this was not OK, as the test output that we checked included these links being printed verbatim without being converted 😬
This PR adds this conversion from href links to escape characters to our console formatter. And this time I did properly check that this works as expected in the console