You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Command Palette, there is a new action called Refactor with Preview... In order to run this, highlight some code, select the option by searching and running Refactor with Preview... and it should open up the refactoring menu with some options. Click on any of the options and the Refactor Preview (bulk editor) should open up in the workbench. Clicking on the refactorings available in the Refactor Preview pane will open up a side-by-side view in the editor. Edits must be made in a saved file, or the side-by-side will not show up.
Things to keep in mind: Currently the UX is not excellent - we're simply using the refactor preview from the bulk editor, so the preview pane itself might get incredibly bloated with ↩️ (new line indicators) and lots of red highlighted + crossed out code. The core refactoring results should not change.
After clicking on the option from refactoring menu:
After clicking in the refactoring preview pane:
Testing:
Highlight some code you want to refactor.
Run the command Refactor with Preview from the command palette.
A menu will pop up with refactoring options - click on a valid highlighted option.
Clicking on any of the menu options will open up the workbench and the refactoring preview pane, similar to Rename Symbol.
Note that all highlighted lines will be checkmarked, but you have the option to uncheck certain lines and apply the refactoring of only that specific line.
Click on the lines of edited code in the preview pane to pull up the preview in the editor.
Apply the refactoring preview - depending on what kind of refactoring was chosen. An additional prompt about renaming the extracted function may be triggered as well.
CTRL + Z and highlight the same bit of code. Run Refactor and the same type of refactoring.
Ensure that the two versions of refactoring, with or without preview, have the same end refactored results.
Some Questions:
Since the bulk edit pane was intended for smaller changes with a larger quantity of files, it may not precisely fit the kind of refactoring we want. Does this version of refactoring help, and are there better ways to indicate differences when refactoring?
Is there a better flow to get to the refactoring preview screen (ie. having the Refactoring with Preview in the context menu, or having fly-outs instead of in the workbench, etc).
The text was updated successfully, but these errors were encountered:
Refs #151140
Complexity: 2
Create Issue
Set up:
In the Command Palette, there is a new action called
Refactor with Preview...
In order to run this, highlight some code, select the option by searching and runningRefactor with Preview...
and it should open up the refactoring menu with some options. Click on any of the options and the Refactor Preview (bulk editor) should open up in the workbench. Clicking on the refactorings available in the Refactor Preview pane will open up a side-by-side view in the editor. Edits must be made in a saved file, or the side-by-side will not show up.Things to keep in mind: Currently the UX is not excellent - we're simply using the refactor preview from the bulk editor, so the preview pane itself might get incredibly bloated with ↩️ (new line indicators) and lots of red highlighted + crossed out code. The core refactoring results should not change.
After clicking on the option from refactoring menu:
After clicking in the refactoring preview pane:
Testing:
Refactor with Preview
from the command palette.Rename Symbol
.CTRL + Z
and highlight the same bit of code. RunRefactor
and the same type of refactoring.Some Questions:
Refactoring with Preview
in the context menu, or having fly-outs instead of in the workbench, etc).The text was updated successfully, but these errors were encountered: