-
Notifications
You must be signed in to change notification settings - Fork 4
feat: add context
to Chunk
#14
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
@yeonjuan Just in case you missed it. |
Hi @TheCommieAxolotl , Thanks for the PR. I have a question. Why we add the context to the result? |
Thanks @yeonjuan, I'm using your package under the hood in an upcoming project of mine and I would like to display the context of diff chunks to the user to help them better understand where their code is. I was thinking about just writing my own parser to run as well as yours but I saw you were using a regex and it would be easy for me to contribute. |
@TheCommieAxolotl I got it. I think it's a bug. The result should contain |
@yeonjuan So you would just add an |
@TheCommieAxolotl Yes Right, the result should contain all lines! |
@yeonjuan I think you may be misunderstanding. The "context" isn't always part of the chunk, sometimes it can refer to a line several hundreds of lines above the current chunk and is just shown for orientation. |
Yes right, But I don't think we need new node type. Isn't this just the unchanged line output from the git-diff command? |
@yeonjuan No, it is a separate part of the diff output. If you don't want to add a new entry to the chunk I understand but I think adding it as an |
|
@TheCommieAxolotl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for the PR!
Adds a
Chunk.context
entry with the context of the Chunke.g.
will result in a chunk with