-
Notifications
You must be signed in to change notification settings - Fork 2.9k
fix(diff-editor)-performance #5581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(diff-editor)-performance #5581
Conversation
✅ Deploy Preview for continuedev canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, very simple addition but makes a huge difference! I tested this with Edit to see how it would behave on a single-range change (i.e. not a full file) and it also worked great, the jump-to-first-line-of-range logic is quite nice.
Thanks for the attention to detail here!
@Patrick-Erichsen thanks! I was a bit shocked by the performance change. I wonder if it has something to do with making changes in the editor outside the currently displayed viewport? None the less it's a quick win. |
Let's keep an eye out for user feedback on this one. Since this effectively forces the viewport to follow along with edits it prevents users from pausing to read the code as it's streamed in. |
Jetbrains, it's also slow. Is there room for optimization? |
Description
When the diff editor was running in vscode it was frustrating that the progress would slowly start from the top of the file and make it's way to the bottom. Sometimes it felt like nothing was happening until the change cursor came into view.
I added code to change the focus in the editor depending on where the current edit is occuring. Interestingly this had the side effect of speeding the whole process up imensely for me. I'm curious if others see the same difference.
I also added code to push the viewport to the top of the file after all the edits are complete to give a visual indication that the process is done. Note, it might be better to focus the editor at the first diff but I didn't see an easy way to determine where that was without a more significant change.
Checklist
Screenshots
[ For visual changes, include screenshots. Screen recordings are particularly helpful, and appreciated! ]
Testing instructions
Summary by mrge
Improved the diff editor in VS Code so the viewport follows edits as they happen, making progress clearer and speeding up the editing process.