Skip to content

@ W-18480465 - Apex full file diff #332

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

Conversation

shaurabh-tiwari-git
Copy link

Screenshot 2025-07-14 at 5 50 49 PM

What does this PR do?

What issues does this PR fix or reference?

@shaurabh-tiwari-git shaurabh-tiwari-git requested a review from a team as a code owner July 14, 2025 12:22
@sf-aastha-paruthi
Copy link

If the diff content is even larger then the one is the attached image, then will the scroll bar come?

const patch: string = createPatch('', originalFileContent, modifiedFileContent);
const patchLines = patch.split('\n');

let origIdx = 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How it will show when the single file has multiple changes within file?

public getFullFileDiff(filename: string, originalFileContent: string, modifiedFileContent: string): DiffPair[] {
const originalLines = originalFileContent.split('\n');
const modifiedLines = modifiedFileContent.split('\n');
const patch: string = createPatch('', originalFileContent, modifiedFileContent);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of writing our own custom logic to derive difference from patch, we can explore and leverage other methods provided by (diff)

Copy link

@sf-aastha-paruthi sf-aastha-paruthi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the diff content is even larger then the one is the attached image, then will the scroll bar come?

@shaurabh-tiwari-git
Copy link
Author

If the diff content is even larger then the one is the attached image, then will the scroll bar come?

Yes, the scrollbar will come when we scroll the file. However it will not always be visible, it will only appear while scrolling.

Copy link

@sf-kishore-kurri sf-kishore-kurri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@sf-kishore-kurri
Copy link

@snehaljha-sf Can you approve and merge the changes

@snehaljha-sf snehaljha-sf merged commit 1dcd373 into salesforcecli:prerelease/alpha Jul 17, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants