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

Treat patches as diff files #5085

Merged
merged 1 commit into from
Dec 10, 2022
Merged

Conversation

danyspin97
Copy link
Contributor

No description provided.

@pascalkuthe pascalkuthe added S-waiting-on-review Status: Awaiting review from a maintainer. A-language-support Area: Support for programming/text languages labels Dec 9, 2022
Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

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

Patch syntax is different from diff syntax though, see the-mikedavis/tree-sitter-diff#1

@danyspin97
Copy link
Contributor Author

.patch files are not always related to the canonical Linux patch format. In the context of Linux distributions (which is where I use helix the most), it is used for any file that is supported by patch, including context diffs and unified diffs.

It seems to me that treating all patches as diff would still have correct highlighting in the actual content; the only thing that wouldn't be correctly shown is the metadata, did I understood correctly?

Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

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

Ah hmm, looks like tree-sitter-diff works ok for patch syntax too, the patch lines just end up as context nodes. In the long-run this file-type should use a separate tree-sitter-patch which parses the metadata and injects tree-sitter-diff but I think this is ok to add for now.

@the-mikedavis the-mikedavis merged commit f323ffa into helix-editor:master Dec 10, 2022
herkhinah pushed a commit to herkhinah/helix that referenced this pull request Dec 11, 2022
freqmod pushed a commit to freqmod/helix that referenced this pull request Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Support for programming/text languages S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants