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

Add delete highlights #589

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Kyle-Ye
Copy link
Collaborator

@Kyle-Ye Kyle-Ye commented May 16, 2023

Bug/issue #, if applicable:

Close #515

Summary

Provide a description of what your PR addresses, explaining the expected user experience.
Also, provide an overview of your implementation.

Dependencies

Describe any dependencies this PR might have, such as an associated branch in another repository.

Testing

Describe how a reviewer can test the functionality of your PR. Provide test content to test with if
applicable.

Steps:

  1. Provide setup instructions.
  2. Explain in detail how the functionality can be tested.

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran the ./bin/test script and it succeeded
  • Updated documentation if necessary

return Result(file: new, highlights: highlights)
let deleteHighlights = diff.removals.compactMap { removal -> Highlight? in
guard case .remove(let offset, _, _) = removal else { return nil }
// Use 1-based indexing for line numbers.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: cleanup the comment (it's the same as above). Perhaps extract that little block into a func if it's reused?

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.

Highlight deleted code
2 participants