Skip to content
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 line number edge cases #7

Closed
andrewpareles opened this issue Sep 17, 2024 · 0 comments
Closed

Fix diff line number edge cases #7

andrewpareles opened this issue Sep 17, 2024 · 0 comments
Assignees
Milestone

Comments

@andrewpareles
Copy link
Contributor

andrewpareles commented Sep 17, 2024

We define a "diff" as a single green/red pair that denotes a change.

We create diffs by using the function getDiffedLines, which takes in an old string and the new string and outputs an array of diffs (like the range of the diff, or the original text of the diff).

image

There are two bugs inside of ApprovalCodeLensProvider.ts:

  • If a diff is "pure" deletion, then startLine > endLine, which causes new vscode.Range() to break. We need to deal with this case instead of just skipping it.
  • If a diff is inserted at the top of a file, then startLine=-1, which causes new vscode.Range() to break.
@andrewpareles andrewpareles added this to the release #1 milestone Sep 17, 2024
@andrewpareles andrewpareles moved this to Good for Starters in 🚙 Void Roadmap Sep 17, 2024
@andrewpareles andrewpareles moved this to Good for Starters in 🚙 Void Roadmap Sep 17, 2024
@andrewpareles andrewpareles changed the title Fix Diff line number bugginess Fix Diff line number edge cases Sep 17, 2024
@mathewpareles mathewpareles changed the title Fix Diff line number edge cases Fix diff line number edge cases Sep 18, 2024
@andrewpareles andrewpareles self-assigned this Sep 23, 2024
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

No branches or pull requests

1 participant