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

Augment query testing procedure #37

Open
resolritter opened this issue Apr 25, 2023 · 3 comments
Open

Augment query testing procedure #37

resolritter opened this issue Apr 25, 2023 · 3 comments

Comments

@resolritter
Copy link
Collaborator

In #36 a script was added for testing that the queries can be compiled correctly, which is not the same as testing that they are producing the expected output. For the latter, we could have something like nvim-treesitter's query tests (see https://github.com/nvim-treesitter/nvim-treesitter/tree/87faf372eb517077cc600c4e653e4fb3252d02ac/tests/query, e.g. https://github.com/nvim-treesitter/nvim-treesitter/blob/87faf372eb517077cc600c4e653e4fb3252d02ac/tests/query/highlights/gleam/import.gleam).


Idea originated from #36 (comment)

@resolritter
Copy link
Collaborator Author

@maxxnino if you have ideas on what would be tested or how this should be done, feel free to post them here

@maxxnino
Copy link
Owner

maxxnino commented Apr 25, 2023

I have two ideas for improving this. The first one is a quick and dirty method that I have already used from the beginning. It involves manually inspecting the highlights generated by nvim-treesitter for the new grammar and making adjustments to improve queries and auto-indent behavior. The second idea is to use treez and build our own tester similar to how nvim-treesitter works. The downside is that every time we change the grammar, we will need to update the test cases accordingly. However, this approach will quickly identify any grammar mismatches. Personally, I prefer the quick and dirty method, but it's up to you to decide which approach is best for you

@maxxnino
Copy link
Owner

The existing query works fine, so nothing needs to be changed. I think my Neovim is just messing around with me.

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

No branches or pull requests

2 participants