nvim-neotest / neotest-go

MIT License
125 stars 43 forks source link

feat: add experimental test table parsing #8

Closed giovanism closed 2 years ago

giovanism commented 2 years ago

I added a query for test table simple enough for my common use case. Right now, it only identifies them by:

image

giovanism commented 2 years ago

Oh and one small thing, the gutter/mark for tests are not located on the @test.name position but on the @test.definition instead. Is there anything the adapter can do? Or this is handled by the main neotest plugin i suppose?

akinsho commented 2 years ago

Oh and one small thing, the gutter/mark for tests are not located on the @test.name position but on the @test.definition instead. Is there anything the adapter can do? Or this is handled by the main neotest plugin i suppose?

Short of re-implementing parsing the treesitter queries in this adapter it's not really possible to tweak the positions, but rcarriga is pretty responsive and helpful so could probably help find some sort of solution. It's not that big a deal IMO though, I guess you could mark the first field as the actual definition maybe and that might work

akinsho commented 2 years ago

Thanks for the PR @giovanism feel free to contribute more if you want to tweak it over time