-
Notifications
You must be signed in to change notification settings - Fork 77
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
SLVS-1746 Change logic so that the diff view window shows all suggested changes that are selectable #5966
SLVS-1746 Change logic so that the diff view window shows all suggested changes that are selectable #5966
Conversation
…om a TextBuffer and to focus a line and that can be reusable.
…select/unselect the changes
public void ApplySuggestedChanges() | ||
{ | ||
Before = textViewEditor.CreateTextBuffer(TextBuffer.CurrentSnapshot.GetText(), TextBuffer.ContentType); | ||
After = textViewEditor.CreateTextBuffer(TextBuffer.CurrentSnapshot.GetText(), TextBuffer.ContentType); |
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.
Can we combine create with preview changes below? Aka CreateUpdatedBuffer?
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.
Why? I think the responsibilities are much clearer this way
{ | ||
try | ||
{ | ||
var line = textView.TextBuffer.CurrentSnapshot.GetLineFromLineNumber(lineNumber); |
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.
DocumentNavigator.Navigate could be reused here. WDYT?
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.
I would need the SnapshotSpan, which I don't have at this point.
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.
They're calculated in ApplyChanges in the same class, could cache them probably
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.
I wouldn't do that. I don't see the advantages
///// The changes are applied from bottom to top to avoid changing the line numbers | ||
///// of the changes that are below the current change. | ||
///// This is important when the change is more lines than the original line range. | ||
///// </summary> |
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.
could create tracking spans for original locations to avoid that?
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.
This is not a logic that I introduced. I moved it away from the FixSuggestionHandler. If you think it's worth improving that, consider creating another task.
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.
A few questions/proposals, but overall is fine
…is applied. Only the After TextBuffer needs to be adapted in this case.
|
e2bb0cb
into
feature/fix-suggestion-diff
…ed changes that are selectable (#5966)
…ed changes that are selectable (#5966)
SLVS-1746
Show all suggested changes in the same window, where the user can select/unselect the desired changes
The logic has also changed a bit: before my changes, if the file was changed and we could not have an exact match between how the text looks on the machine and what we receive from server that it looked like before, we were showing a goldbar. Now we don't show the goldbar and proceed with the diff view. This behavior is also consistent with the one from Vs Code and IntelliJ.