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

make scissor regex independent of the language #14

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

Conversation

sionik
Copy link

@sionik sionik commented Feb 1, 2024

This commit makes the regex used for scissor detection independent of the language of the comment.

For #13, this would be a first (very simple) step.

Apart from that, it will improve the out-of-the-box experience for any user of Helix with a language other than English set.

@the-mikedavis
Copy link
Owner

Does the parser actually work besides the scissors when using another language? If we want to support multiple languages in COMMIT_EDITMSG in Helix then we should probably just switch to gbprod's grammar.

@sionik
Copy link
Author

sionik commented Feb 5, 2024

Sorry for the late reply.
The parser doesn't really work, no. This commit would - with minimal effort - at least get the diff to work after the scissors.

I took a look at gbprod/tree-sitter-gitcommit, but couldn't get it to work with helix (yet).
But if you suggest that instead of building multi-language support into this parser, helix should change the parser, I'm happy to dig deeper into gbprod's repository.

In this case, I would suggest closing #13 and adding a note for this decision in the readme.

@the-mikedavis
Copy link
Owner

Initially I was thinking that you could have different forks of the grammar for different languages but now I think gbprod's approach is more pragmatic so we might as well switch to it if possible. Neovim is using that grammar I believe.

Yeah, if we switch to gbprod's in Helix I would deprecate (maybe archive) this repo. I probably should have closed #13 a while ago as it's a duplicate of #4.

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.

2 participants