Skip to content

Commit

Permalink
fix suggestion realignment logic for rebased commits
Browse files Browse the repository at this point in the history
Summary:
Context: Before the suggestion realignment logic takes the commit head's content and compare it to the text in the VS Code editor.

However when author rebased, the commit head's content could potentially change. Which won't reflect the SuggestedCode's line number.

Solution: Instead of using the commitHeadHash, we use the commit hash for the Code Patch (which reflects the hash when the suggested change was made).

We then compare that text with the editor content to realign or apply changes.

Differential Revision: D65914471

fbshipit-source-id: e4431b4a1717ddbd199217300407d0acdbba87f6
  • Loading branch information
Jack Huang authored and facebook-github-bot committed Nov 14, 2024
1 parent 418a409 commit 5288e24
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions addons/isl/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export type SuggestedChange = {
id?: string;
codePatchSuggestionID?: string;
status?: CodePatchSuggestionStatus;
commitHashBefore?: string;
patch?: ParsedDiff;
oldPath?: string;
currentPath?: string;
Expand Down

0 comments on commit 5288e24

Please sign in to comment.