Skip to content
This repository has been archived by the owner on May 19, 2024. It is now read-only.

Incorrectly checking if line is in hunk when creating line comments #18

Open
andrew-myer opened this issue Apr 10, 2024 · 1 comment · May be fixed by #17
Open

Incorrectly checking if line is in hunk when creating line comments #18

andrew-myer opened this issue Apr 10, 2024 · 1 comment · May be fixed by #17

Comments

@andrew-myer
Copy link

andrew-myer commented Apr 10, 2024

Describe the bug
When using the Commenter's WriteMultiLineComment or WriteLineComment functions with a single-line edit, comments are returning CommentNotValidError errors because they are incorrectly determined to be outside of a hunk.

To Reproduce
Steps to reproduce the behavior:

  1. Make a single line edit and use Commenter.WriteMultiLineComment or Commenter.WriteLineComment for that line
  2. CommentNotValidError is returned

Expected behavior
If a line is in a hunk, the comment shouldn't be invalid.

@andrew-myer
Copy link
Author

andrew-myer commented Apr 10, 2024

@owenrumney I setup a potential fix that's been working for my case #17 . Please let me know if any extra details/help is needed 😄

@andrew-myer andrew-myer changed the title hunkInfo.isLineInHunk doesn't correctly check if line is in hunk for WriteMultiLineComment hunkInfo.isLineInHunk doesn't correctly check if line is in hunk for WriteMultiLineComment Apr 10, 2024
@andrew-myer andrew-myer changed the title hunkInfo.isLineInHunk doesn't correctly check if line is in hunk for WriteMultiLineComment hunkInfo.isLineInHunk doesn't correctly check if line is in hunk for when creating comments Apr 10, 2024
@andrew-myer andrew-myer changed the title hunkInfo.isLineInHunk doesn't correctly check if line is in hunk for when creating comments hunkInfo.isLineInHunk doesn't correctly check if line is in hunk for when creating line comments Apr 10, 2024
@andrew-myer andrew-myer changed the title hunkInfo.isLineInHunk doesn't correctly check if line is in hunk for when creating line comments Incorrectly checking if line is in hunk when creating line comments Apr 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant