[DX] Add links to open the editor to the names of processed files and the names of rules applied #6272
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.
Adds a new config option which provides capabilities similar to the
editorUrl
option in PHStan, see https://phpstan.org/user-guide/output-format#opening-file-in-an-editorYou use it by calling the
withEditorURL()
function with a URL template that when clicked will open a file in your editor, for example:The editor URL allows the following template variables:
%file%
: the absolute path to the file%relFile%
the relative path to the file%line%
the line numberThis matches the template variables used by PHPStan
If this configuration is set, Rector will add editor links in the file name at the top of each file diff. When clicked this will open that file and line in your editor. This allows you to check any change that has been made or which has been suggested by Rector
You need to be using a terminal which understands these links to get this to work. If you are using a terminal which does not understand these links, these texts will be displayed as normal texts just like before.
See the attached video to see how it works.
Screen.Recording.2024-09-01.at.17.mp4