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

Handle corner cases such as lines with single characters or lines beginning with J #1

Merged
merged 3 commits into from
Oct 9, 2024

Conversation

PigeonF
Copy link
Contributor

@PigeonF PigeonF commented Oct 4, 2024

The current implementation chokes when a line starts with a capital J, and skips lines that consist of only a single character.

I have added a test with some corner cases I thought of, but was only able to handle them by manually checking for newlines (you can see that extras is set to [] now), as the text would otherwise end up with newlines in them when parsing single characters.

In the repo description it says that this is a mirror of the sourcehut version, but I did not find a mailing list on the sourcehut to send patches to (https://lists.sr.ht/~kareigu/tree-sitter-jjdescription gives 404). If there is some other way to contribute other than through GitHub pull requests, please let me know!

@kareigu
Copy link
Owner

kareigu commented Oct 4, 2024

Thanks for taking a look at this!

This was a compromise I made at the time due to having absolutely no clue what I'm doing in terms of creating a grammar :D

I was originally going to have this mirrored over but since some editors seem to prefer Github for these grammars, I think I'll just move it over here so a PR is just fine :P

I'm currently on a holiday trip so I'll probably take a look at this some time next week once I'm back home.
Thanks again!

@kareigu kareigu merged commit 23dd3dd into kareigu:dev Oct 9, 2024
@kareigu
Copy link
Owner

kareigu commented Oct 9, 2024

This was great, big thanks!

I've opened a PR on the Helix side to bump the version there.
If you want to follow when it lands upstream: helix-editor/helix#11857

@PigeonF PigeonF deleted the PigeonF/push-vtwuylmrrsns branch December 21, 2024 12:03
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