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

Add initial textobjects.scm #331

Merged
merged 2 commits into from
Nov 26, 2023

Conversation

peterkos
Copy link
Contributor

@peterkos peterkos commented Nov 7, 2023

Hi!

I also noticed there wasn't a textobjects.scm, and decided to take a crack at it -- this allows for inter-function, (almost) inter-test jumping in helix, for instance :)

Happy to add more or if y'all want to use as a jumping off point, feel free.

I got setup with the playground, which was relatively simple on macOS:

brew install tree-sitter
brew install emscripten
tree-sitter build-wasm
tree-sitter playground

Signed-off-by: Peter Kos <pkos91@icloud.com>
@peterkos peterkos force-pushed the peterkos/textobjects branch from f5889b2 to a7e0b83 Compare November 7, 2023 05:39
@alex-pinkus
Copy link
Owner

Thanks for doing this! Whenever you're ready for review, just make sure you rebase to fix CI.

I'll hold off on releasing 0.4.0 until these changes are ready, unless you think you'll need quite a lot of time for this.

@alex-pinkus
Copy link
Owner

Something to look into, only if you have the time and inclination, not at all required: is there any way to add tests for this, like we have highlight tests?

@peterkos
Copy link
Contributor Author

peterkos commented Nov 8, 2023

I'll try to get somethin' up by tomorrow 🚀

Are you thinking as in test-npm-package/index.js, or a reference file (which is what test/highlight/* seems like)?

I'm thinking something like what the tree-sitter playground view demonstrates at least -- which could also point out common-but-not-added scenarios:

@alex-pinkus
Copy link
Owner

I'm thinking something analogous to the contents of test/highlight/*, which gets picked up by tree-sitter test and validated on every build. Nothing fancy like the packaging tests. If tree-sitter test gives us a format for validating these things, we should use that, otherwise no need to bother!

@peterkos
Copy link
Contributor Author

Ah! This!

I had a bunch of issues trying to run the playground locally for some reason, it kept spinning me into an infinite loop when I modified the query :(

Cool if we go forward as-is?

@peterkos peterkos marked this pull request as ready for review November 26, 2023 03:09
@alex-pinkus
Copy link
Owner

Totally! Like I said, not at all required

@alex-pinkus alex-pinkus merged commit f1a48a3 into alex-pinkus:main Nov 26, 2023
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