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

feat(rust): add more queries and tests #407

Merged
merged 1 commit into from
Feb 24, 2024

Conversation

tjkirch
Copy link
Contributor

@tjkirch tjkirch commented Feb 24, 2024

I went through the tree-sitter-rust corpus and added all of the missing statement types that open a new context. I added an example usage of each one to the test file.

I'm new to tree-sitter, but the tests (and some other cases I tried) appear to show the correct context. Some things are debatable - for example, you could make a context for every array expression, but I chose to only do so for ones inside a let declaration, because that gives it a name, and unnamed arrays don't seem to provide as much value. Happy to discuss any of those choices. :)

@tjkirch
Copy link
Contributor Author

tjkirch commented Feb 24, 2024

Sorry about the initial CI failure; I didn't initially understand the test that checks nvim-test output. It looks like it's checking that a buffer looks exactly as expected with regard to treesitter, so I updated the expected output to match the actual, since I updated the test file to show off all the new queries. Let me know if that was incorrect, or if I need to test something else.

@lewis6991
Copy link
Member

LGTM. Thanks

@lewis6991 lewis6991 merged commit e4a259f into nvim-treesitter:master Feb 24, 2024
2 checks passed
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