Skip to content

How are you meant to implement discover_positions? #385

Answered by rcarriga
ColinKennedy asked this question in Q&A
Discussion options

You must be logged in to vote

Unfortunately the treesitter library is just meant for helper methods, it's not guaranteed to work for everyone. The problem here is that it assumes a file structure where child positions are within the scope of the parent which is not going to be the case with how your tests are defined where the suite name is just an argument.

The gtest adapter had similar issues and it looks like they went with the manual tree building as well, maybe take a look and see if you can re-use some of their logic? https://github.com/alfaix/neotest-gtest/blob/main/lua/neotest-gtest/parse.lua

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ColinKennedy
Comment options

Answer selected by ColinKennedy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants