Skip to content

Fix diff line number edge cases #7

@andrewpareles

Description

@andrewpareles

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions